[-] MO : #PSTEST-44 : Category cannot be parent of herself

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11411 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
lLefevre
2011-12-20 14:28:01 +00:00
parent 348d0227f9
commit cb07593455
2 changed files with 372 additions and 369 deletions
@@ -315,13 +315,17 @@ class AdminCategoriesControllerCore extends AdminController
if (Tools::isSubmit('submitAdd'.$this->table))
{
if ($id_category = (int)Tools::getValue('id_category'))
$id_category = (int)Tools::getValue('id_category');
$id_parent = (int)Tools::getValue('id_parent');
if ($id_category)
{
if (!Category::checkBeforeMove($id_category, $this->_category->id_parent))
if ($id_category != $id_parent)
{
$this->_errors[] = Tools::displayError('Category cannot be moved here');
return false;
if (!Category::checkBeforeMove($id_category, $id_parent))
$this->_errors[] = Tools::displayError($this->l('Category cannot be moved here'));
}
else
$this->_errors[] = Tools::displayError($this->l('Category cannot be parent of herself.'));
}
}
/* Delete object */