Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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('
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user