diff --git a/classes/Category.php b/classes/Category.php index d814db0be..86122e9a7 100644 --- a/classes/Category.php +++ b/classes/Category.php @@ -210,7 +210,7 @@ class CategoryCore extends ObjectModel if (!isset($this->doNotRegenerateNTree) || !$this->doNotRegenerateNTree) { Category::regenerateEntireNtree(); - $this->recalculateLevelDepth($this->id_category); + $this->recalculateLevelDepth($this->id); } Hook::exec('actionCategoryUpdate', array('category' => $this)); return $ret; @@ -264,7 +264,7 @@ class CategoryCore extends ObjectModel $this->description = Category::getDescriptionClean($this->description); return array( - 'id' => (int)$this->id_category, + 'id' => (int)$this->id, 'link' => Context::getContext()->link->getCategoryLink($this->id, $this->link_rewrite), 'name' => $this->name, 'desc'=> $this->description, @@ -964,8 +964,8 @@ class CategoryCore extends ObjectModel $root_category = Category::getRootCategory(); if (Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP && (!Tools::isSubmit('id_category') || - (int)Tools::getValue('id_category') == (int)$root_category->id_category || - (int)$root_category->id_category == (int)$context->shop->id_category)) + (int)Tools::getValue('id_category') == (int)$root_category->id || + (int)$root_category->id == (int)$context->shop->id_category)) $sql .= ' AND c.`id_parent` != 0'; diff --git a/classes/Configuration.php b/classes/Configuration.php index af7c23b66..1f2312a25 100644 --- a/classes/Configuration.php +++ b/classes/Configuration.php @@ -323,7 +323,7 @@ class ConfigurationCore extends ObjectModel $result &= Db::getInstance()->update('configuration', array( 'value' => pSQL($value, $html), 'date_upd' => date('Y-m-d H:i:s'), - ), '`name` = \''.pSQL($key).'\''.Configuration::sqlRestriction($id_shop_group, $id_shop), true, true); + ), '`name` = \''.pSQL($key).'\''.Configuration::sqlRestriction($id_shop_group, $id_shop), 1, true); } else { @@ -504,7 +504,7 @@ class ConfigurationCore extends ObjectModel { if ($id_shop) return ' AND id_shop = '.(int)$id_shop; - else if ($id_shop_group) + elseif ($id_shop_group) return ' AND id_shop_group = '.(int)$id_shop_group.' AND id_shop IS NULL'; else return ' AND id_shop_group IS NULL AND id_shop IS NULL'; diff --git a/controllers/admin/AdminCategoriesController.php b/controllers/admin/AdminCategoriesController.php index 8b6838fed..1c6395ed2 100644 --- a/controllers/admin/AdminCategoriesController.php +++ b/controllers/admin/AdminCategoriesController.php @@ -177,7 +177,7 @@ class AdminCategoriesControllerCore extends AdminController $categories_tree = $this->_category->getParentsCategories(); if (empty($categories_tree) - && ($this->_category->id_category != 1 || Tools::isSubmit('id_category')) + && ($this->_category->id != 1 || Tools::isSubmit('id_category')) && (Shop::getContext() == Shop::CONTEXT_SHOP && !$is_multishop && $count_categories_without_parent > 1)) $categories_tree = array(array('name' => $this->_category->name[$this->context->language->id])); @@ -322,7 +322,7 @@ class AdminCategoriesControllerCore extends AdminController $guest_group_information = sprintf($this->l('%s - Customer who placed an order with the Guest Checkout.'), ''.$guest->name[$this->context->language->id].''); $default_group_information = sprintf($this->l('%s - All people who have created an account on this site.'), ''.$default->name[$this->context->language->id].''); $root_category = Category::getRootCategory(); - $root_category = array('id_category' => $root_category->id_category, 'name' => $root_category->name); + $root_category = array('id_category' => $root_category->id, 'name' => $root_category->name); $this->fields_form = array( 'tinymce' => true, 'legend' => array( diff --git a/controllers/admin/AdminShopController.php b/controllers/admin/AdminShopController.php index 02ab4ed3c..71bab9f66 100755 --- a/controllers/admin/AdminShopController.php +++ b/controllers/admin/AdminShopController.php @@ -196,7 +196,7 @@ class AdminShopControllerCore extends AdminController { $root_category = new Category((int)Tools::getValue('id_category')); $root_category = array( - 'id_category' => $root_category->id_category, + 'id_category' => $root_category->id, 'name' => $root_category->name[$this->context->language->id] ); $selected_cat = array($root_category['id_category']); @@ -629,7 +629,7 @@ class AdminShopControllerCore extends AdminController $selected_cat[] = $root_categories[0]['id_category']; foreach ($children as $child) - $selected_cat[] = $child->id_category; + $selected_cat[] = $child->id; } if (Shop::getContext() == Shop::CONTEXT_SHOP && Tools::isSubmit('id_shop')) $root_category = new Category($shop->id_category);