From bd14ab595ae499fe8b213df154759b8151a353ad Mon Sep 17 00:00:00 2001 From: fSerny Date: Wed, 2 Nov 2011 12:42:48 +0000 Subject: [PATCH] // Fix on Module API for retrocompatibility --- classes/Module.php | 2 +- classes/PaymentModule.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/classes/Module.php b/classes/Module.php index 85fa9686f..ab0fd3221 100644 --- a/classes/Module.php +++ b/classes/Module.php @@ -840,7 +840,7 @@ abstract class ModuleCore $sql .= ' LEFT JOIN `'._DB_PREFIX_.'group_module_restriction` gmr ON gmr.`id_module` = m.`id_module`'; $sql .= ' - WHERE h.`name` = \''.$hookPayment.'\' + WHERE h.`name` = \''.pSQL($hookPayment).'\' AND mc.id_country = '.(int)($billing->id_country).' AND mc.id_shop = '.(int)$context->shop->getID(true).' AND mg.id_shop = '.(int)$context->shop->getID(true).' diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php index d4c1eba6d..8c2475614 100644 --- a/classes/PaymentModule.php +++ b/classes/PaymentModule.php @@ -538,12 +538,16 @@ abstract class PaymentModuleCore extends Module */ public static function getInstalledPaymentModules() { + $hookPayment = 'Payment'; + if (Db::getInstance()->getValue('SELECT `id_hook` FROM `'._DB_PREFIX_.'hook` WHERE `name` = \'displayPayment\'')) + $hookPayment = 'displayPayment'; + return Db::getInstance()->executeS(' SELECT DISTINCT m.`id_module`, h.`id_hook`, m.`name`, hm.`position` FROM `'._DB_PREFIX_.'module` m LEFT JOIN `'._DB_PREFIX_.'hook_module` hm ON hm.`id_module` = m.`id_module` LEFT JOIN `'._DB_PREFIX_.'hook` h ON hm.`id_hook` = h.`id_hook` - WHERE h.`name` = \'payment\' + WHERE h.`name` = \''.pSQL($hookPayment).'\' AND m.`active` = 1 '); }