Parcourir la source

Fix for "Create and Add" button to pick up active sub class

tom0 il y a 13 ans
Parent
commit
789d51bfd4
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  1. 5 1
      Controller/CRUDController.php

+ 5 - 1
Controller/CRUDController.php

@@ -303,7 +303,11 @@ class CRUDController extends Controller
         }
 
         if ($this->get('request')->get('btn_create_and_create')) {
-            $url = $this->admin->generateUrl('create');
+            $params = array();
+            if ($this->admin->hasActiveSubClass()) {
+                $params['subclass'] = $this->get('request')->get('subclass');
+            }
+            $url = $this->admin->generateUrl('create', $params);
         }
 
         if (!$url) {