From 84ecba99a7f3adfbcab016bb15c3cc09d5f9f9ba Mon Sep 17 00:00:00 2001 From: fGaillard Date: Mon, 26 Dec 2011 15:36:37 +0000 Subject: [PATCH] [-] BO : #PSTEST-180 : BugFix : Insert new attributes in groups git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11770 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/AdminController.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/classes/AdminController.php b/classes/AdminController.php index e2ba59697..c7515df13 100644 --- a/classes/AdminController.php +++ b/classes/AdminController.php @@ -580,10 +580,10 @@ class AdminControllerCore extends Controller */ public function processSave($token) { - if ($this->id_object) - return $this->processUpdate($token); - else + if ((!$this->id_object) || (!Tools::getValue('submitAdd'.$this->table))) return $this->processAdd($token); + else + return $this->processUpdate($token); } /** @@ -642,7 +642,7 @@ class AdminControllerCore extends Controller /* Checking fields validity */ $this->validateRules(); - if (!count($this->_errors)) + if (count($this->_errors) <= 0) { $id = (int)Tools::getValue($this->identifier); @@ -713,7 +713,6 @@ class AdminControllerCore extends Controller ' '.$this->table.' '.Tools::displayError('(cannot load object)'); } } - $this->_errors = array_unique($this->_errors); if (count($this->_errors) > 0) return;