Skip to content

Commit 91f4deb

Browse files
committed
fix: show KB items without category
1 parent dca5afb commit 91f4deb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

inc/knowbase.class.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,16 @@ public static function getFaqItems($rootCategory = 0, $keywords = '') {
197197

198198
$table_cat = getTableForItemType('KnowbaseItemCategory');
199199
$selectedCategories = [];
200-
$selectedCategories = getSonsOf($table_cat, $rootCategory);
201-
$selectedCategories[$rootCategory] = $rootCategory;
200+
if ($rootCategory != 0) {
201+
$selectedCategories = getSonsOf($table_cat, $rootCategory);
202+
$selectedCategories[$rootCategory] = $rootCategory;
203+
}
202204

203205
$params = [
204206
'faq' => '1',
205207
'contains' => $keywords
206208
];
209+
$params['knowbaseitemcategories_id'] = 0;
207210
if (count($selectedCategories) > 0) {
208211
$params['knowbaseitemcategories_id'] = $selectedCategories;
209212
}

0 commit comments

Comments
 (0)