From 66974a05e04fe211fcbcab8033e80a69c33af296 Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Wed, 9 Jan 2013 13:44:19 +0100 Subject: [PATCH] [-] BO : fixed bug #PSCFV-4961 - Strange behavior when reordering categories --- classes/controller/AdminController.php | 2 +- classes/helper/HelperList.php | 4 ++-- controllers/admin/AdminCategoriesController.php | 2 +- controllers/admin/AdminCmsCategoriesController.php | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index fd6891d8d..78bb412a2 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -1465,7 +1465,7 @@ class AdminControllerCore extends Controller if (!in_array($action, $this->actions) && isset($this->$action) && $this->$action) $this->actions[] = $action; } - + $helper->is_cms = $this->is_cms; $list = $helper->generateList($this->_list, $this->fields_list); return $list; diff --git a/classes/helper/HelperList.php b/classes/helper/HelperList.php index ba58389d8..f0f206606 100644 --- a/classes/helper/HelperList.php +++ b/classes/helper/HelperList.php @@ -60,7 +60,7 @@ class HelperListCore extends Helper /** @var array $cache_lang use to cache texts in current language */ public static $cache_lang = array(); - protected $is_cms = false; + public $is_cms = false; public $position_identifier; @@ -174,7 +174,7 @@ class HelperListCore extends Helper public function displayListContent() { if ($this->position_identifier) - $id_category = (int)Tools::getValue('id_'.($this->is_cms ? 'cms_' : '').'category', '1'); + $id_category = (int)Tools::getValue('id_'.($this->is_cms ? 'cms_' : '').'category', ($this->is_cms ? '1' : Category::getRootCategory()->id )); else $id_category = Category::getRootCategory()->id; diff --git a/controllers/admin/AdminCategoriesController.php b/controllers/admin/AdminCategoriesController.php index 6bc46693d..68e9f11a9 100644 --- a/controllers/admin/AdminCategoriesController.php +++ b/controllers/admin/AdminCategoriesController.php @@ -168,7 +168,7 @@ class AdminCategoriesControllerCore extends AdminController if (Shop::getContext() == Shop::CONTEXT_SHOP) $this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'category_shop` sa ON (a.`id_category` = sa.`id_category` AND sa.id_shop = '.(int)$this->context->shop->id.') '; else - $this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'category_shop` sa ON (a.`id_category` = sa.`id_category` AND sa.id_shop = a.id_shop_default) '; + $this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'category_shop` sa ON (a.`id_category` = sa.`id_category` AND sa.id_shop = a.id_shop_default) '; // we add restriction for shop diff --git a/controllers/admin/AdminCmsCategoriesController.php b/controllers/admin/AdminCmsCategoriesController.php index a46b1d947..cb0a199c1 100644 --- a/controllers/admin/AdminCmsCategoriesController.php +++ b/controllers/admin/AdminCmsCategoriesController.php @@ -33,6 +33,7 @@ class AdminCmsCategoriesControllerCore extends AdminController public function __construct() { + $this->is_cms = true; $this->table = 'cms_category'; $this->className = 'CMSCategory'; $this->lang = true;