From 52d9b4c27731b1b5ecdcd641ebddf7d45af08558 Mon Sep 17 00:00:00 2001 From: tDidierjean Date: Mon, 20 Feb 2012 14:14:39 +0000 Subject: [PATCH] // fix redirection on edit page if errors are present git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13463 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/controller/AdminController.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index bd3da62aa..fa8b61b77 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -636,9 +636,9 @@ class AdminControllerCore extends Controller } $this->errors = array_unique($this->errors); - if (count($this->errors) > 0) + if (!empty($this->errors)) { - // if we have errors, we stay on the form instead of moving to the list + // if we have errors, we stay on the form instead of going back to the list $this->display = 'edit'; return false; } @@ -731,7 +731,12 @@ class AdminControllerCore extends Controller } $this->errors = array_unique($this->errors); if (!empty($this->errors)) - return; + { + // if we have errors, we stay on the form instead of going back to the list + $this->display = 'edit'; + return false; + } + if (isset($object)) return $object; return;