[-] BO : Fixed SQL crash with an empty shop list #PSCFV-2946
This commit is contained in:
@@ -232,7 +232,7 @@
|
|||||||
id="shop_select_add"
|
id="shop_select_add"
|
||||||
style="text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px"
|
style="text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px"
|
||||||
>
|
>
|
||||||
|
{l s='Add'} >>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -943,9 +943,9 @@ class CartRuleCore extends ObjectModel
|
|||||||
$shop_list = '';
|
$shop_list = '';
|
||||||
if ($type == 'shop')
|
if ($type == 'shop')
|
||||||
{
|
{
|
||||||
$shop_list = ' AND t.id_shop IN (';
|
|
||||||
$shops = Context::getContext()->employee->getAssociatedShops();
|
$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)
|
if (!Validate::isLoadedObject($this) OR $this->{$type.'_restriction'} == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user