From cc79b6a675e4d4b978edc629f261c3951cbed0b5 Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Fri, 24 May 2013 10:47:48 +0200 Subject: [PATCH 1/4] [-] BO : fixed bug #PSCFV-9178 - is_color_group is not inserted correctly --- classes/AttributeGroup.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/classes/AttributeGroup.php b/classes/AttributeGroup.php index 8a8548379..665ec87f2 100644 --- a/classes/AttributeGroup.php +++ b/classes/AttributeGroup.php @@ -70,6 +70,11 @@ class AttributeGroupCore extends ObjectModel public function add($autodate = true, $nullValues = false) { + if ($this->group_type == 'color') + $this->is_color_group = 1; + else + $this->is_color_group = 0; + if ($this->position <= 0) $this->position = AttributeGroup::getHigherPosition() + 1; @@ -80,11 +85,16 @@ class AttributeGroupCore extends ObjectModel public function update($nullValues = false) { + if ($this->group_type == 'color') + $this->is_color_group = 1; + else + $this->is_color_group = 0; + $return = parent::update($nullValues); Hook::exec('actionAttributeGroupSave', array('id_attribute_group' => $this->id)); return $return; } - + public static function cleanDeadCombinations() { $attribute_combinations = Db::getInstance()->executeS(' From 3b5f18a96dfde6f54a551cc6b4073ce2023495f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Fri, 24 May 2013 11:28:07 +0200 Subject: [PATCH 2/4] [-] BO: Fix language deletion with multishop when shops still associate to the language #PSCFV-9244 --- classes/Language.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/Language.php b/classes/Language.php index 3ce4b1908..6f0469774 100644 --- a/classes/Language.php +++ b/classes/Language.php @@ -466,7 +466,7 @@ class LanguageCore extends ObjectModel public function delete() { - if (!$this->hasMultishopEntries()) + if (!$this->hasMultishopEntries() || Shop::getContext() == Shop::CONTEXT_ALL) { if (empty($this->iso_code)) $this->iso_code = Language::getIsoById($this->id); @@ -514,7 +514,7 @@ class LanguageCore extends ObjectModel if (!parent::delete()) return false; - if (!$this->hasMultishopEntries()) + if (!$this->hasMultishopEntries() || Shop::getContext() == Shop::CONTEXT_ALL) { // delete images $files_copy = array( @@ -831,4 +831,4 @@ class LanguageCore extends ObjectModel { return (Language::countActiveLanguages() > 1); } -} +} \ No newline at end of file From 3de79c701582d9f486533e21b030ec17d5f710fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Fri, 24 May 2013 11:33:58 +0200 Subject: [PATCH 3/4] // same for attributes and attributegroups --- classes/Attribute.php | 4 ++-- classes/AttributeGroup.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/Attribute.php b/classes/Attribute.php index c27e409b3..93391bc6c 100644 --- a/classes/Attribute.php +++ b/classes/Attribute.php @@ -71,7 +71,7 @@ class AttributeCore extends ObjectModel public function delete() { - if (!$this->hasMultishopEntries()) + if (!$this->hasMultishopEntries() || Shop::getContext() == Shop::CONTEXT_ALL) { $result = Db::getInstance()->executeS('SELECT id_product_attribute FROM '._DB_PREFIX_.'product_attribute_combination WHERE id_attribute = '.(int)$this->id); foreach ($result as $row) @@ -343,4 +343,4 @@ class AttributeCore extends ObjectModel return (is_numeric($position)) ? $position : -1; } -} +} \ No newline at end of file diff --git a/classes/AttributeGroup.php b/classes/AttributeGroup.php index 665ec87f2..15f72122a 100644 --- a/classes/AttributeGroup.php +++ b/classes/AttributeGroup.php @@ -119,7 +119,7 @@ class AttributeGroupCore extends ObjectModel public function delete() { - if (!$this->hasMultishopEntries()) + if (!$this->hasMultishopEntries() || Shop::getContext() == Shop::CONTEXT_ALL) { /* Select children in order to find linked combinations */ $attribute_ids = Db::getInstance()->executeS(' From 3b1a9f9f805e106a4dd8454b85ca071f58161bb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=E7ois=20Gaillard?= Date: Fri, 24 May 2013 11:39:20 +0200 Subject: [PATCH 4/4] [-] BO : Fixed unregistered version field for some modules --- classes/module/Module.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/classes/module/Module.php b/classes/module/Module.php index fb70d9075..234897db7 100644 --- a/classes/module/Module.php +++ b/classes/module/Module.php @@ -311,6 +311,12 @@ abstract class ModuleCore */ public static function initUpgradeModule($module) { + if (((int)$module->installed == 1) & (empty($module->database_version) === true)) + { + Module::upgradeModuleVersion($module->name, $module->version); + $module->database_version = $module->version; + } + // Init cache upgrade details self::$modules_cache[$module->name]['upgrade'] = array( 'success' => false, // bool to know if upgrade succeed or not