Parcourir la source

Fix issue with nested admin and create action

Thomas Rabaix il y a 13 ans
Parent
commit
e172203b1c
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      Controller/CRUDController.php

+ 2 - 2
Controller/CRUDController.php

@@ -373,11 +373,11 @@ class CRUDController extends Controller
 
 
         $object = $this->admin->getNewInstance();
         $object = $this->admin->getNewInstance();
 
 
+        $this->admin->setSubject($object);
+
         $form = $this->admin->getForm();
         $form = $this->admin->getForm();
         $form->setData($object);
         $form->setData($object);
 
 
-        $this->admin->setSubject($object);
-
         if ($this->get('request')->getMethod() == 'POST') {
         if ($this->get('request')->getMethod() == 'POST') {
             $form->bindRequest($this->get('request'));
             $form->bindRequest($this->get('request'));