Skip to content

Commit

Permalink
fix: don't show all categories for empty categories, closes #2901
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed Apr 19, 2024
1 parent 75b156e commit 3e4223f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion phpmyfaq/show.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@
$categoryHelper
->setConfiguration($faqConfig)
->setCategory($subCategory);

if (empty($records)) {
$records = $categoryHelper->renderCategoryTree();
$records = sprintf('<div class="mb-5 alert alert-info">%s</div>', Translation::get('err_noArticles'));
}

if (is_countable($category->getChildNodes((int) $selectedCategoryId)) ? count($category->getChildNodes((int) $selectedCategoryId)) : 0) {
$categoryFaqsHeader = Translation::get('msgSubCategories');
$subCategoryContent = $categoryHelper->renderCategoryTree($selectedCategoryId);
Expand Down

0 comments on commit 3e4223f

Please sign in to comment.