Skip to content

Commit

Permalink
fix: show KB items without category
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Oct 10, 2022
1 parent dca5afb commit 91f4deb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions inc/knowbase.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,16 @@ public static function getFaqItems($rootCategory = 0, $keywords = '') {

$table_cat = getTableForItemType('KnowbaseItemCategory');
$selectedCategories = [];
$selectedCategories = getSonsOf($table_cat, $rootCategory);
$selectedCategories[$rootCategory] = $rootCategory;
if ($rootCategory != 0) {
$selectedCategories = getSonsOf($table_cat, $rootCategory);
$selectedCategories[$rootCategory] = $rootCategory;
}

$params = [
'faq' => '1',
'contains' => $keywords
];
$params['knowbaseitemcategories_id'] = 0;
if (count($selectedCategories) > 0) {
$params['knowbaseitemcategories_id'] = $selectedCategories;
}
Expand Down

0 comments on commit 91f4deb

Please sign in to comment.