diff --git a/install-dev/upgrade/php/block_category_1521.php b/install-dev/upgrade/php/block_category_1521.php index a132475ed..4ff4d086b 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()->getValue('SELECT FROM `'._DB_PREFIX_.'configuration` WHERE `name` LIKE \'BLOCK_CATEG_MAX_DEPTH\' ')) + if (!Db::getInstance()->getValue('SELECT value 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\', 4, NOW(), NOW())'); - else if ($maxdepth = (int)Db::getInstance()->getValue('SELECT FROM `'._DB_PREFIX_.'configuration` WHERE `value` IS NOT NULL AND `value` <> 0')) + else if ($maxdepth = (int)Db::getInstance()->getValue('SELECT value FROM `'._DB_PREFIX_.'configuration` WHERE `value` IS NOT NULL AND `value` <> 0 AND `name` LIKE \'BLOCK_CATEG_MAX_DEPTH\'')) Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'configuration` SET `value` = '.($maxdepth + 1).' WHERE `name` LIKE \'BLOCK_CATEG_MAX_DEPTH\''); } \ No newline at end of file