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 8a8548379..15f72122a 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(' @@ -109,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(' 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 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