Browse Source

Fix issue with nested admin and create action

Thomas Rabaix 13 years ago
parent
commit
e172203b1c
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Controller/CRUDController.php

+ 2 - 2
Controller/CRUDController.php

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