[-] BO : Fixed SQL crash with an empty shop list #PSCFV-2946

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16243 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
dMetzger
2012-07-05 14:18:22 +00:00
parent 0b98d953d2
commit 64648e0826
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -943,9 +943,9 @@ class CartRuleCore extends ObjectModel
$shop_list = '';
if ($type == 'shop')
{
$shop_list = ' AND t.id_shop IN (';
$shops = Context::getContext()->employee->getAssociatedShops();
$shop_list .= implode(array_map('intval', $shops), ',').')';
if (count($shops))
$shop_list = ' AND t.id_shop IN ('.implode(array_map('intval', $shops), ',').') ';
}
if (!Validate::isLoadedObject($this) OR $this->{$type.'_restriction'} == 0)