From 61557f2fd03930bfe643b6958f216a466a8e6d09 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Thu, 11 Apr 2013 17:34:15 +0200 Subject: [PATCH] [-] FO : Fix bug #PSCFV-8589 do not loose max level depth when upgrading --- install-dev/upgrade/php/block_category_1521.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install-dev/upgrade/php/block_category_1521.php b/install-dev/upgrade/php/block_category_1521.php index fe7c6825b..c6b1846f7 100644 --- a/install-dev/upgrade/php/block_category_1521.php +++ b/install-dev/upgrade/php/block_category_1521.php @@ -26,11 +26,11 @@ function block_category_1521() { - if (!Db::getInstance()->ExecuteS('SELECT `'._DB_PREFIX_.'configuration` WHERE `name`=\'BLOCK_CATEG_MAX_DEPTH\' ')) + if (!Db::getInstance()->getValue('SELECT FROM `'._DB_PREFIX_.'configuration` WHERE `name` LIKE \'BLOCK_CATEG_MAX_DEPTH\' ')) Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'configuration` (`id_configuration` ,`id_shop_group` ,`id_shop` ,`name` ,`value` ,`date_add` ,`date_upd`) - VALUES (NULL, NULL, NULL, \'BLOCK_CATEG_MAX_DEPTH\', 2, NOW(), NOW())'); - else if (Db::getInstance()->ExecuteS('SELECT `'._DB_PREFIX_.'configuration` WHERE and `value` IS NOT NULL AND `value` <> 0')) - Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'configuration` SET `value` = 2 WHERE `name`=\'BLOCK_CATEG_MAX_DEPTH\' '); + VALUES (NULL, NULL, NULL, \'BLOCK_CATEG_MAX_DEPTH\', 4, NOW(), NOW())'); + else if ($maxdepth = (int)Db::getInstance()->getValue('SELECT FROM `'._DB_PREFIX_.'configuration` WHERE `value` IS NOT NULL AND `value` <> 0')) + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'configuration` SET `value` = '.($maxdepth + 1).' WHERE `name` LIKE\'BLOCK_CATEG_MAX_DEPTH\''); } \ No newline at end of file