瀏覽代碼

Merge pull request #863 from lopsided/master

Fix for "Create and add another" button when using inherited classes
Thomas 13 年之前
父節點
當前提交
8ebc06ce4b
共有 1 個文件被更改,包括 5 次插入1 次删除
  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) {