Browse Source

Fixed an issue with one to many relations

As described in #2325
Daniele Bartocci 10 years ago
parent
commit
ce36d747fe
1 changed files with 3 additions and 0 deletions
  1. 3 0
      Form/Type/AdminType.php

+ 3 - 0
Form/Type/AdminType.php

@@ -30,6 +30,9 @@ class AdminType extends AbstractType
     public function buildForm(FormBuilderInterface $builder, array $options)
     {
         $admin = clone $this->getAdmin($options);
+        if ($admin->hasParentFieldDescription()) {
+            $admin->getParentFieldDescription()->setAssociationAdmin($admin);
+        }
 
         if ($options['delete'] && $admin->isGranted('DELETE')) {
             $builder->add('_delete', 'checkbox', array('required' => false, 'mapped' => false, 'translation_domain' => $admin->getTranslationDomain()));