mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-23 16:13:50 +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:
@@ -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()
|
||||
|
Reference in New Issue
Block a user