From a78366d502cc578737d04fd394c032dff612b4d3 Mon Sep 17 00:00:00 2001 From: fBrignoli Date: Thu, 3 May 2012 14:48:26 +0000 Subject: [PATCH] // incorrect SQL query --- classes/Module.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/classes/Module.php b/classes/Module.php index fead95e9c..62f34d2f6 100644 --- a/classes/Module.php +++ b/classes/Module.php @@ -1228,6 +1228,8 @@ abstract class ModuleCore $context = Context::getContext(); if (isset($context->cart)) $billing = new Address((int)$context->cart->id_address_invoice); + + $groups = array(); if (isset($context->customer)) $groups = $context->customer->getGroups(); @@ -1250,7 +1252,7 @@ abstract class ModuleCore AND mg.id_shop = '.(int)$context->shop->id.' AND (SELECT COUNT(*) FROM '._DB_PREFIX_.'module_shop ms WHERE ms.id_module = m.id_module AND ms.id_shop IN('.implode(', ', $list).')) = '.count($list).' AND hm.id_shop IN('.implode(', ', $list).') - '.(isset($groups) ? 'AND (mg.`id_group` IN('.implode(', ', $groups).'))' : '').' + '.(count($groups) ? 'AND (mg.`id_group` IN('.implode(', ', $groups).'))' : '').' GROUP BY hm.id_hook, hm.id_module ORDER BY hm.`position`, m.`name` DESC'; $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);