From 998ef4263ef7ee77d13dd6a0f5e91e2108854555 Mon Sep 17 00:00:00 2001 From: vChabot Date: Tue, 13 Mar 2012 17:06:20 +0000 Subject: [PATCH] [-] BO : BugFix : #PSFV-1020 : category reduction can be deleted now git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14109 b9a71923-0436-4b27-9f14-aed3839534dd --- admin-dev/functions.php | 3 ++- controllers/admin/AdminGroupsController.php | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/admin-dev/functions.php b/admin-dev/functions.php index 9a9dae11a..9a06203cd 100644 --- a/admin-dev/functions.php +++ b/admin-dev/functions.php @@ -162,7 +162,8 @@ function getPath($urlBase, $id_category, $path = '', $highlight = '', $categoryT $nCategories = (int)sizeof($categories); foreach ($categories AS $category) { - $edit = ' '; + $link = Context::getContext()->link->getAdminLink('AdminCategories'); + $edit = ' '; $fullPath .= $edit. ($n < $nCategories ? '' : ''). (!empty($highlight) ? str_ireplace($highlight, ''.htmlentities($highlight, ENT_NOQUOTES, 'UTF-8').'', $category['name']) : $category['name']). diff --git a/controllers/admin/AdminGroupsController.php b/controllers/admin/AdminGroupsController.php index 44c806d39..f5e651656 100644 --- a/controllers/admin/AdminGroupsController.php +++ b/controllers/admin/AdminGroupsController.php @@ -437,6 +437,18 @@ class AdminGroupsControllerCore extends AdminController } } } + else + { + // if we have no category reduction anymore, we delete the existing ones + Db::getInstance()->execute(' + DELETE FROM `'._DB_PREFIX_.'group_reduction` + WHERE `id_group` = '.(int)Tools::getValue('id_group') + ); + Db::getInstance()->execute(' + DELETE FROM `'._DB_PREFIX_.'product_group_reduction_cache` + WHERE `id_group` = '.(int)Tools::getValue('id_group') + ); + } } /**