diff --git a/install-dev/upgrade/php/add_new_tab.php b/install-dev/upgrade/php/add_new_tab.php index 009244a3e..246bb0ac7 100644 --- a/install-dev/upgrade/php/add_new_tab.php +++ b/install-dev/upgrade/php/add_new_tab.php @@ -24,8 +24,13 @@ * International Registered Trademark & Property of PrestaShop SA */ -function add_new_tab($className, $name, $id_parent, $returnId = false) +function add_new_tab($className, $name, $id_parent, $returnId = false, $parentTab) { + if (isset($parentTab) && !empty($parentTab) && (is_null($id_parent) || empty($id_parent))) + $id_parent = (int)Db::getInstance()->getValue('SELECT `id_tab` FROM `'._DB_PREFIX_.'tab` WHERE `class_name` = \''.pSQL($parentTab).'\''); + if (!$id_parent) + return false; + $array = array(); foreach (explode('|', $name) AS $item) { diff --git a/install-dev/upgrade/sql/1.5.4.0.sql b/install-dev/upgrade/sql/1.5.4.0.sql index 75da0cf64..9f486c66c 100644 --- a/install-dev/upgrade/sql/1.5.4.0.sql +++ b/install-dev/upgrade/sql/1.5.4.0.sql @@ -31,7 +31,7 @@ CREATE TABLE `PREFIX_tab_module_preference` ( UNIQUE KEY `employee_module` (`id_employee`, `id_tab`, `module`) ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; -/* PHP:add_new_tab(AdminMarketing, es:Marketing|it:Marketing|en:Marketing|de:Marketing|fr:Marketing, 1); */; +/* PHP:add_new_tab(AdminMarketing, es:Marketing|it:Marketing|en:Marketing|de:Marketing|fr:Marketing, 0, false, AdminPriceRule); */; /* PHP:p1540_add_missing_columns(); */;