// Clean AdminController methods did not return the appropriate value #PSCFV-3645
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16876 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -363,8 +363,9 @@ class AdminGroupsControllerCore extends AdminController
|
||||
else
|
||||
{
|
||||
$this->updateCategoryReduction();
|
||||
parent::processSave();
|
||||
$object = parent::processSave();
|
||||
$this->updateRestrictions();
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1579,6 +1579,8 @@ class AdminProductsControllerCore extends AdminController
|
||||
}
|
||||
else
|
||||
$this->errors[] = Tools::displayError('An error occurred while creating object.').' <b>'.$this->table.'</b>';
|
||||
|
||||
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.').' <b>'.$this->table.'</b> ('.Tools::displayError('Cannot load object').')';
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -319,6 +319,7 @@ class AdminSpecificPriceRuleControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
$object->apply();
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user