diff --git a/controllers/admin/AdminAddressesController.php b/controllers/admin/AdminAddressesController.php index 46679ac79..39bb2d2be 100644 --- a/controllers/admin/AdminAddressesController.php +++ b/controllers/admin/AdminAddressesController.php @@ -370,7 +370,7 @@ class AdminAddressesControllerCore extends AdminController } if (empty($this->errors)) - parent::processSave(); + return parent::processSave(); else // if we have errors, we stay on the form instead of going back to the list $this->display = 'edit'; diff --git a/controllers/admin/AdminAttributesGroupsController.php b/controllers/admin/AdminAttributesGroupsController.php index e6b8fa3e5..e05af6ffb 100644 --- a/controllers/admin/AdminAttributesGroupsController.php +++ b/controllers/admin/AdminAttributesGroupsController.php @@ -386,7 +386,7 @@ class AdminAttributesGroupsControllerCore extends AdminController */ public function processAdd() { - parent::processAdd(); + $object = parent::processAdd(); if (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && !count($this->errors)) { @@ -398,6 +398,8 @@ class AdminAttributesGroupsControllerCore extends AdminController if (count($this->errors)) $this->setTypeAttribute(); + + return $object; } /** @@ -406,7 +408,7 @@ class AdminAttributesGroupsControllerCore extends AdminController */ public function processUpdate() { - parent::processUpdate(); + $object = parent::processUpdate(); if (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && !count($this->errors)) { @@ -418,6 +420,8 @@ class AdminAttributesGroupsControllerCore extends AdminController if (count($this->errors)) $this->setTypeAttribute(); + + return $object; } /** diff --git a/controllers/admin/AdminCategoriesController.php b/controllers/admin/AdminCategoriesController.php index 14af56665..666ee8409 100644 --- a/controllers/admin/AdminCategoriesController.php +++ b/controllers/admin/AdminCategoriesController.php @@ -532,10 +532,13 @@ class AdminCategoriesControllerCore extends AdminController else $this->errors[] = Tools::displayError($this->l('Category cannot be parent of itself.')); } - parent::processAdd(); + $object = parent::processAdd(); + //if we create a you root category you have to associate to a shop before to add sub categories in. So we redirect to AdminCategories listing if (Tools::isSubmit('is_root_category')) Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getAdminTokenLite('AdminCategories').'&conf=3'); + + return $object; } protected function setDeleteMode() diff --git a/controllers/admin/AdminCustomersController.php b/controllers/admin/AdminCustomersController.php index 1c47a8bbe..25cd252eb 100644 --- a/controllers/admin/AdminCustomersController.php +++ b/controllers/admin/AdminCustomersController.php @@ -731,11 +731,12 @@ class AdminCustomersControllerCore extends AdminController { $this->errors[] = Tools::displayError('An account already exists for this e-mail address:').' '.$customer_email; $this->display = 'edit'; + return $customer; } elseif ($customer = parent::processAdd()) { $this->context->smarty->assign('new_customer', $customer); - return true; + return $customer; } return false; } diff --git a/controllers/admin/AdminFeaturesController.php b/controllers/admin/AdminFeaturesController.php index 857c47871..fe2ed18f3 100644 --- a/controllers/admin/AdminFeaturesController.php +++ b/controllers/admin/AdminFeaturesController.php @@ -400,10 +400,12 @@ class AdminFeaturesControllerCore extends AdminController */ public function processAdd() { - parent::processAdd(); + $object = parent::processAdd(); if (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && !count($this->errors)) $this->redirect_after = self::$currentIndex.'&'.$this->identifier.'=&conf=3&update'.$this->table.'&token='.$this->token; + + return $object; } /** @@ -412,10 +414,12 @@ class AdminFeaturesControllerCore extends AdminController */ public function processUpdate() { - parent::processUpdate(); + $object = parent::processUpdate(); if (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && !count($this->errors)) $this->redirect_after = self::$currentIndex.'&'.$this->identifier.'=&conf=3&update'.$this->table.'&token='.$this->token; + + return $object; } /** @@ -442,7 +446,7 @@ class AdminFeaturesControllerCore extends AdminController if (preg_match('/^name_/Ui', $key)) $_POST[$key] = str_replace ('\n', '', str_replace('\r', '', $value)); } - parent::processSave(); + return parent::processSave(); } /** diff --git a/controllers/admin/AdminGroupsController.php b/controllers/admin/AdminGroupsController.php index 5819bb288..3be10a459 100644 --- a/controllers/admin/AdminGroupsController.php +++ b/controllers/admin/AdminGroupsController.php @@ -363,8 +363,9 @@ class AdminGroupsControllerCore extends AdminController else { $this->updateCategoryReduction(); - parent::processSave(); + $object = parent::processSave(); $this->updateRestrictions(); + return $object; } } diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 281f0d35f..80d01c419 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -1579,6 +1579,8 @@ class AdminProductsControllerCore extends AdminController } else $this->errors[] = Tools::displayError('An error occurred while creating object.').' '.$this->table.''; + + return $this->object; } protected function isTabSubmitted($tab_name) @@ -1707,6 +1709,7 @@ class AdminProductsControllerCore extends AdminController } else $this->errors[] = Tools::displayError('An error occurred while updating object.').' '.$this->table.' ('.Tools::displayError('Cannot load object').')'; + return $object; } } diff --git a/controllers/admin/AdminShopUrlController.php b/controllers/admin/AdminShopUrlController.php index 821be71df..542faea67 100644 --- a/controllers/admin/AdminShopUrlController.php +++ b/controllers/admin/AdminShopUrlController.php @@ -370,7 +370,7 @@ class AdminShopUrlControllerCore extends AdminController if (($object->main || Tools::getValue('main')) && !Tools::getValue('active')) $this->errors[] = Tools::displayError('You can\'t disable a Main URL'); - parent::processAdd(); + return parent::processAdd(); } public function processUpdate() diff --git a/controllers/admin/AdminSpecificPriceRuleController.php b/controllers/admin/AdminSpecificPriceRuleController.php index 57bb0a701..db8dca09e 100755 --- a/controllers/admin/AdminSpecificPriceRuleController.php +++ b/controllers/admin/AdminSpecificPriceRuleController.php @@ -319,6 +319,7 @@ class AdminSpecificPriceRuleControllerCore extends AdminController } } $object->apply(); + return $object; } } }