// fix module group upgrade
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15521 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -27,6 +27,9 @@
|
|||||||
|
|
||||||
function add_default_restrictions_modules_groups()
|
function add_default_restrictions_modules_groups()
|
||||||
{
|
{
|
||||||
|
// Table module_group had another use in previous versions, we need to clean it up.
|
||||||
|
Db::getInstance()->executeS('TRUNCATE TABLE `'._DB_PREFIX_.'module_group`');
|
||||||
|
|
||||||
$groups = Db::getInstance()->executeS('
|
$groups = Db::getInstance()->executeS('
|
||||||
SELECT `id_group`
|
SELECT `id_group`
|
||||||
FROM `'._DB_PREFIX_.'group`');
|
FROM `'._DB_PREFIX_.'group`');
|
||||||
@@ -45,7 +48,7 @@ function add_default_restrictions_modules_groups()
|
|||||||
$sql = 'INSERT INTO `'._DB_PREFIX_.'module_group` (`id_module`, `id_shop`, `id_group`) VALUES ';
|
$sql = 'INSERT INTO `'._DB_PREFIX_.'module_group` (`id_module`, `id_shop`, `id_group`) VALUES ';
|
||||||
foreach ($modules as $mod)
|
foreach ($modules as $mod)
|
||||||
foreach ($shops as $s)
|
foreach ($shops as $s)
|
||||||
$sql .= '("'.(int)$mod['id_module'].'", "'.(int)$s.'", "'.(int)$group['id_group'].'"),';
|
$sql .= '("'.(int)$mod['id_module'].'", "'.(int)$s.'", "'.(int)$group['id_group'].'"),';
|
||||||
// removing last comma to avoid SQL error
|
// removing last comma to avoid SQL error
|
||||||
$sql = substr($sql, 0, strlen($sql) - 1);
|
$sql = substr($sql, 0, strlen($sql) - 1);
|
||||||
Db::getInstance()->execute($sql);
|
Db::getInstance()->execute($sql);
|
||||||
|
|||||||
@@ -208,7 +208,6 @@ ALTER TABLE `PREFIX_product` ADD `is_virtual` TINYINT( 1 ) NOT NULL DEFAULT '0'
|
|||||||
|
|
||||||
/* PHP:add_new_tab(AdminProducts, fr:Produits|es:Productos|en:Products|de:Produkten|it:Prodotti, 1); */;
|
/* PHP:add_new_tab(AdminProducts, fr:Produits|es:Productos|en:Products|de:Produkten|it:Prodotti, 1); */;
|
||||||
/* PHP:add_new_tab(AdminCategories, fr:Catégories|es:Categoria|en:Categories|de:Kategorien|it:Categories, 1); */;
|
/* PHP:add_new_tab(AdminCategories, fr:Catégories|es:Categoria|en:Categories|de:Kategorien|it:Categories, 1); */;
|
||||||
/* PHP:add_default_restrictions_modules_groups(); */;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `PREFIX_employee_shop` (
|
CREATE TABLE IF NOT EXISTS `PREFIX_employee_shop` (
|
||||||
`id_employee` INT( 11 ) UNSIGNED NOT NULL ,
|
`id_employee` INT( 11 ) UNSIGNED NOT NULL ,
|
||||||
|
|||||||
@@ -52,3 +52,4 @@ UPDATE `PREFIX_tab` SET `class_name`="AdminShopGroup" WHERE class_name="AdminGro
|
|||||||
|
|
||||||
/* PHP:upgrade_cms_15_rename(); */;
|
/* PHP:upgrade_cms_15_rename(); */;
|
||||||
/* PHP:migrate_tabs_multi_shop(); */;
|
/* PHP:migrate_tabs_multi_shop(); */;
|
||||||
|
/* PHP:add_default_restrictions_modules_groups(); */;
|
||||||
|
|||||||
Reference in New Issue
Block a user