From bb0732ca79ff4ebcb990e5cd98697e8dede625be Mon Sep 17 00:00:00 2001 From: Adrien Clairembault <42734840+AdrienClairembault@users.noreply.github.com> Date: Thu, 13 Oct 2022 09:03:05 +0200 Subject: [PATCH] fix(wizard): FAQ list (#3031) --- inc/knowbase.class.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/inc/knowbase.class.php b/inc/knowbase.class.php index 71999a0c0..9f83bffb6 100644 --- a/inc/knowbase.class.php +++ b/inc/knowbase.class.php @@ -105,20 +105,19 @@ public static function getCategoryTree() { [ 'SELECT' => ['COUNT DISTINCT' => KnowbaseItem::getTableField('id') . ' as cpt'], 'FROM' => KnowbaseItem::getTable(), - 'LEFT JOIN' => [ + 'INNER JOIN' => [ KnowbaseItem_KnowbaseItemCategory::getTable() => [ 'FKEY' => [ KnowbaseItem::getTable() => 'id', KnowbaseItem_KnowbaseItemCategory::getTable() => KnowbaseItem::getForeignKeyField(), ], ], - KnowbaseItemCategory::getTable() => [ - 'FKEY' => [ - KnowbaseItem_KnowbaseItemCategory::getTable() => KnowbaseItemCategory::getForeignKeyField(), - KnowbaseItemCategory::getTable() => 'id', - ], - ], ], + 'WHERE' => [ + KnowbaseItem_KnowbaseItemCategory::getTableField($cat_fk) => new QueryExpression( + $DB->quoteName(KnowbaseItemCategory::getTableField('id')) + ), + ] ], $kbitem_visibility_crit ), @@ -230,4 +229,4 @@ public static function getFaqItems($rootCategory = 0, $keywords = '') { return ['default' => [], 'forms' => $formList]; } -} \ No newline at end of file +}