[-] BO : #PSCFV-2569 - Fix CMS category duplication

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15713 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mDeflotte
2012-05-28 14:48:09 +00:00
parent cbf6cd352e
commit 526d2cac1a
@@ -35,12 +35,12 @@ class AdminCmsCategoriesControllerCore extends AdminController
public function __construct() public function __construct()
{ {
$this->table = 'cms_category'; $this->table = 'cms_category';
$this->className = 'CMSCategory'; $this->className = 'CMSCategory';
$this->lang = true; $this->lang = true;
$this->addRowAction('view'); $this->addRowAction('view');
$this->addRowAction('edit'); $this->addRowAction('edit');
$this->addRowAction('delete'); $this->addRowAction('delete');
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
$this->fields_list = array( $this->fields_list = array(
'id_cms_category' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 30), 'id_cms_category' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 30),
@@ -86,6 +86,7 @@ class AdminCmsCategoriesControllerCore extends AdminController
$this->action = 'save'; $this->action = 'save';
if ($id_cms_category = (int)Tools::getValue('id_cms_category')) if ($id_cms_category = (int)Tools::getValue('id_cms_category'))
{ {
$this->id_object = $id_cms_category;
if (!CMSCategory::checkBeforeMove($id_cms_category, (int)Tools::getValue('id_parent'))) if (!CMSCategory::checkBeforeMove($id_cms_category, (int)Tools::getValue('id_parent')))
{ {
$this->errors[] = Tools::displayError('CMS Category cannot be moved here'); $this->errors[] = Tools::displayError('CMS Category cannot be moved here');
@@ -193,7 +194,7 @@ class AdminCmsCategoriesControllerCore extends AdminController
else else
$this->errors[] = Tools::displayError('You do not have permission to delete here.'); $this->errors[] = Tools::displayError('You do not have permission to delete here.');
} }
parent::postProcess(true); parent::postProcess();
} }
public function renderForm() public function renderForm()