mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
fix form for new custom group
If the CustomFieldGroup->getEntity is not set, the form for creation throw an error
This commit is contained in:
parent
0c2b5f3fb4
commit
0cecb67645
@ -49,11 +49,16 @@ class CustomFieldsGroupType extends AbstractType
|
||||
))
|
||||
;
|
||||
|
||||
$builder->addEventListener(FormEvents::POST_SET_DATA, function(FormEvent $event)
|
||||
use ($customizableEntities, $builder){
|
||||
$builder->addEventListener(FormEvents::POST_SET_DATA,
|
||||
function(FormEvent $event) use ($customizableEntities, $builder){
|
||||
$form = $event->getForm();
|
||||
$group = $event->getData();
|
||||
|
||||
//stop the function if entity is not set
|
||||
if ($group->getEntity() === NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (count($customizableEntities[$group->getEntity()]['options']) > 0) {
|
||||
$optionBuilder = $builder
|
||||
->getFormFactory()
|
||||
|
Loading…
x
Reference in New Issue
Block a user