From 6af3fa4fe00c10cd5beceaf987f8a63cf8750ada Mon Sep 17 00:00:00 2001 From: mDeflotte Date: Tue, 10 Jan 2012 15:11:51 +0000 Subject: [PATCH] [-] BO : #PSTEST-400 - Fixed problem with adding attribute --- .../admin/AdminAttributesGroupsController.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/controllers/admin/AdminAttributesGroupsController.php b/controllers/admin/AdminAttributesGroupsController.php index 7a6a41b28..2e77e838b 100644 --- a/controllers/admin/AdminAttributesGroupsController.php +++ b/controllers/admin/AdminAttributesGroupsController.php @@ -422,12 +422,6 @@ class AdminAttributesGroupsControllerCore extends AdminController 'desc' => $this->l('Save and stay'), ); - $this->toolbar_btn['save-and-stay'] = array( - 'short' => 'SaveAndStay', - 'href' => '#', - 'desc' => $this->l('Save and stay'), - ); - $back = self::$currentIndex.'&token='.$this->token; $this->toolbar_btn['cancel'] = array( 'href' => $back, @@ -489,7 +483,9 @@ class AdminAttributesGroupsControllerCore extends AdminController */ public function processSave($token) { - if ((int)Tools::getValue('id_attribute') <= 0 && (int)Tools::getValue('id_attribute_group') <= 0 ) + if ((int)Tools::getValue('id_attribute') <= 0 && $this->display != 'add' + || (int)Tools::getValue('id_attribute_group') <= 0 && $this->display == 'add' + ) return $this->processAdd($token); else return $this->processUpdate($token); @@ -591,9 +587,8 @@ class AdminAttributesGroupsControllerCore extends AdminController $_POST[$key] = str_replace ('\n', '', str_replace('\r', '', $value)); parent::postProcess(); } - else { + else parent::postProcess(); - } } } }