[-] INSTALLER : Fix bug #PSCFV-8750 do not activate disabled module during upgrade
This commit is contained in:
@@ -66,18 +66,21 @@ function deactivate_custom_modules()
|
||||
|
||||
$uninstallMe = array("undefined-modules");
|
||||
if (is_array($arrNonNative))
|
||||
foreach($arrNonNative as $aModule)
|
||||
$uninstallMe[] = $aModule['name'];
|
||||
foreach($arrNonNative as $k => $aModule)
|
||||
$uninstallMe[(int)$aModule['id_module']] = $aModule['name'];
|
||||
|
||||
if (!is_array($uninstallMe))
|
||||
$uninstallMe = array($uninstallMe);
|
||||
|
||||
foreach ($uninstallMe as $k=>$v)
|
||||
foreach ($uninstallMe as $k => $v)
|
||||
$uninstallMe[$k] = '"'.pSQL($v).'"';
|
||||
|
||||
return Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'module`
|
||||
SET `active`= 0
|
||||
WHERE `name` IN ('.implode(',',$uninstallMe).')');
|
||||
}
|
||||
$return = Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'module` SET `active` = 0 WHERE `name` IN ('.implode(',', $uninstallMe).')');
|
||||
|
||||
if (count(Db::getInstance()->executeS('SHOW TABLES LIKE \''._DB_PREFIX_.'module_shop\''))> 0)
|
||||
foreach($uninstallMe as $k => $uninstall)
|
||||
$return &= Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'module_shop` WHERE `id_module` = '.(int)$k);
|
||||
|
||||
return $return;
|
||||
}
|
||||
Reference in New Issue
Block a user