From b012c7955734e104cd99df90b81f6c69a7ac8833 Mon Sep 17 00:00:00 2001 From: vChabot Date: Tue, 28 Feb 2012 08:56:56 +0000 Subject: [PATCH] [-] BO : BugFix : #PSFV-556 : Category problem - new category not properly assigned to root git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13655 b9a71923-0436-4b27-9f14-aed3839534dd --- controllers/admin/AdminCategoriesController.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/controllers/admin/AdminCategoriesController.php b/controllers/admin/AdminCategoriesController.php index 7e129a82e..afeea4937 100644 --- a/controllers/admin/AdminCategoriesController.php +++ b/controllers/admin/AdminCategoriesController.php @@ -241,6 +241,15 @@ class AdminCategoriesControllerCore extends AdminController parent::initToolbar(); if ($this->_category->id == Category::getTopCategory()->id && isset($this->toolbar_btn['new'])) unset($this->toolbar_btn['new']); + // after adding a category + if (empty($this->display)) + { + $id_category = (Tools::isSubmit('id_category')) ? '&id_parent='.(int)Tools::getValue('id_category') : ''; + $this->toolbar_btn['new'] = array( + 'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token.$id_category, + 'desc' => $this->l('Add new') + ); + } } public function initProcess()