From 76bf4353efa8f03390811477b52652527dcd034d Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Tue, 11 Sep 2012 15:14:51 +0000 Subject: [PATCH] [-] CORE : fixed bug #PSCFV-3889 --- classes/Category.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/Category.php b/classes/Category.php index 205ffd98c..289cef41e 100644 --- a/classes/Category.php +++ b/classes/Category.php @@ -1181,12 +1181,12 @@ class CategoryCore extends ObjectModel */ public static function getLastPosition($id_category_parent, $id_shop) { - return (Db::getInstance()->getValue(' - SELECT MAX(cs.`position`)+1 + return (int)(Db::getInstance()->getValue(' + SELECT MAX(cs.`position`) FROM `'._DB_PREFIX_.'category` c LEFT JOIN `'._DB_PREFIX_.'category_shop` cs ON (c.`id_category` = cs.`id_category` AND cs.`id_shop` = '.(int)$id_shop.') - WHERE c.`id_parent` = '.(int)$id_category_parent)); + WHERE c.`id_parent` = '.(int)$id_category_parent) + 1); } public static function getUrlRewriteInformations($id_category)