diff --git a/controllers/admin/AdminAttributesGroupsController.php b/controllers/admin/AdminAttributesGroupsController.php index 1b4ec706f..42d26f8cf 100644 --- a/controllers/admin/AdminAttributesGroupsController.php +++ b/controllers/admin/AdminAttributesGroupsController.php @@ -369,7 +369,12 @@ class AdminAttributesGroupsControllerCore extends AdminController parent::processAdd($token); if (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && !count($this->errors)) - $this->redirect_after = self::$currentIndex.'&'.$this->identifier.'=&conf=3&update'.$this->table.'&token='.$token; + { + if ($this->display == 'add') + $this->redirect_after = self::$currentIndex.'&'.$this->identifier.'=&conf=3&update'.$this->table.'&token='.$token; + else + $this->redirect_after = self::$currentIndex.'&'.$this->identifier.'=&id_attribute_group='.(int)Tools::getValue('id_attribute_group').'&conf=3&update'.$this->table.'&token='.$token; + } } /** @@ -381,7 +386,12 @@ class AdminAttributesGroupsControllerCore extends AdminController parent::processUpdate($token); if (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && !count($this->errors)) - $this->redirect_after = self::$currentIndex.'&'.$this->identifier.'=&conf=3&update'.$this->table.'&token='.$token; + { + if ($this->display == 'add') + $this->redirect_after = self::$currentIndex.'&'.$this->identifier.'=&conf=3&update'.$this->table.'&token='.$token; + else + $this->redirect_after = self::$currentIndex.'&'.$this->identifier.'=&id_attribute_group='.(int)Tools::getValue('id_attribute_group').'&conf=3&update'.$this->table.'&token='.$token; + } } /** @@ -513,7 +523,7 @@ class AdminAttributesGroupsControllerCore extends AdminController if ($this->display == 'add') $this->identifier = 'id_attribute_group'; else - $this->identifier = 'id_attribute_group'; + $this->identifier = 'id_attribute'; if ((int)Tools::getValue('id_attribute_group') <= 0 && $this->display == 'add' || (int)Tools::getValue('id_attribute') <= 0 && $this->display != 'add') diff --git a/controllers/admin/AdminFeaturesController.php b/controllers/admin/AdminFeaturesController.php index efdd65697..e855b969d 100644 --- a/controllers/admin/AdminFeaturesController.php +++ b/controllers/admin/AdminFeaturesController.php @@ -409,7 +409,7 @@ class AdminFeaturesControllerCore extends AdminController if (!$feature_value->update()) $this->errors[] = Tools::displayError('An error has occured: Can\'t save the current feature value'); else if (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && !count($this->errors)) - Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'=&conf=3&update'.$this->table.'&token='.$this->token); + Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'=&id_feature='.(int)Tools::getValue('id_feature').'&conf=3&update'.$this->table.'&token='.$this->token); else Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token); } @@ -419,7 +419,7 @@ class AdminFeaturesControllerCore extends AdminController if (!$feature_value->add()) $this->errors[] = Tools::displayError('An error has occured: Can\'t save the current feature value'); else if (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && !count($this->errors)) - Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'=&conf=3&update'.$this->table.'&token='.$this->token); + Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'=&id_feature='.(int)Tools::getValue('id_feature').'&conf=3&update'.$this->table.'&token='.$this->token); else Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token); }