From e02cc320ee892ddcb7366a8ab47e325fc54d2439 Mon Sep 17 00:00:00 2001 From: rGaillard Date: Tue, 22 Nov 2011 21:18:24 +0000 Subject: [PATCH] // CMS - Add shop filters git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10476 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/CMS.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/classes/CMS.php b/classes/CMS.php index a8df4d8b0..a1764ae03 100644 --- a/classes/CMS.php +++ b/classes/CMS.php @@ -100,10 +100,12 @@ class CMSCore extends ObjectModel SELECT c.id_cms, cl.link_rewrite, cl.meta_title FROM '._DB_PREFIX_.'cms c LEFT JOIN '._DB_PREFIX_.'cms_lang cl ON (c.id_cms = cl.id_cms AND cl.id_lang = '.(int)($id_lang).') + '.Context::getContext()->shop->addSqlAssociation('cms', 'c').' WHERE 1 '.(($selection !== null) ? ' AND c.id_cms IN ('.implode(',', array_map('intval', $selection)).')' : ''). ($active ? ' AND c.`active` = 1 ' : ''). - 'ORDER BY c.`position`'); + 'GROUP BY c.id_cms + ORDER BY c.`position`'); $links = array(); if ($result) @@ -124,8 +126,10 @@ class CMSCore extends ObjectModel SELECT c.id_cms, l.meta_title FROM '._DB_PREFIX_.'cms c JOIN '._DB_PREFIX_.'cms_lang l ON (c.id_cms = l.id_cms) + '.Context::getContext()->shop->addSqlAssociation('cms', 'c').' '.(($id_block) ? 'JOIN '._DB_PREFIX_.'block_cms b ON (c.id_cms = b.id_cms)' : '').' WHERE l.id_lang = '.(int)($id_lang).(($id_block) ? ' AND b.id_block = '.(int)($id_block) : '').($active ? ' AND c.`active` = 1 ' : '').' + GROUP BY c.id_cms ORDER BY c.`position`'); }