Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error SQL in getRecurseCategory method #15926

Merged
merged 5 commits into from Oct 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions classes/CMSCategory.php
Expand Up @@ -195,10 +195,12 @@ public static function getRecurseCategory($id_lang = null, $current = 1, $active
FROM `' . _DB_PREFIX_ . 'cms` c
' . Shop::addSqlAssociation('cms', 'c') . '
JOIN `' . _DB_PREFIX_ . 'cms_lang` cl ON c.`id_cms` = cl.`id_cms`
WHERE `id_cms_category` = ' . (int) $current . '
AND cl.`id_lang` = ' . (int) $id_lang . ($active ? ' AND c.`active` = 1' : '') . '
WHERE `id_cms_category` = ' . (int) $current . ($active ? ' AND c.`active` = 1' : '') . '
AND cl.`id_shop` = ' . (int) Context::getContext()->shop->id . '
AND cl.`id_lang` = ' . (int) $id_lang . '
GROUP BY c.id_cms
ORDER BY c.`position`';

$category['cms'] = Db::getInstance()->executeS($sql);
if ($links == 1) {
$category['link'] = $link->getCMSCategoryLink($current, $category['link_rewrite']);
Expand Down