浏览代码

Merge pull request #2048 from ValikDev/fix-crudcontroller

Fixed CRUDController::redirectTo() behavior
Thomas 11 年之前
父节点
当前提交
d9bf22f830
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      Controller/CRUDController.php

+ 5 - 5
Controller/CRUDController.php

@@ -367,14 +367,14 @@ class CRUDController extends Controller
     {
         $url = false;
 
-        if ($this->get('request')->get('btn_update_and_list')) {
+        if (null !== $this->get('request')->get('btn_update_and_list')) {
             $url = $this->admin->generateUrl('list');
         }
-        if ($this->get('request')->get('btn_create_and_list')) {
+        if (null !== $this->get('request')->get('btn_create_and_list')) {
             $url = $this->admin->generateUrl('list');
         }
 
-        if ($this->get('request')->get('btn_create_and_create')) {
+        if (null !== $this->get('request')->get('btn_create_and_create')) {
             $params = array();
             if ($this->admin->hasActiveSubClass()) {
                 $params['subclass'] = $this->get('request')->get('subclass');
@@ -521,11 +521,11 @@ class CRUDController extends Controller
 
             // persist if the form was valid and if in preview mode the preview was approved
             if ($isFormValid && (!$this->isInPreviewMode() || $this->isPreviewApproved())) {
-                
+
                 if (false === $this->admin->isGranted('CREATE', $object)) {
                     throw new AccessDeniedException();
                 }
-                
+
                 $this->admin->create($object);
 
                 if ($this->isXmlHttpRequest()) {