No Code Attached Yet bug
avatar pioada
pioada
14 Mar 2024

Steps to reproduce the issue

Create some categories. In com_finder create filter with these categories. Search for these categories with applied filter (search menu item with this filter or &f={x} in search url).

Expected result

Categories should be displayed in result list with or without filtering.

Actual result

Categories are found only when results are not filtered. When filtering is applied, categories are not displayed in result list.

System information (as much as possible)

Joomla 4.4.3. Same in 5.0.3.

Additional comments

The problem is that the category is only assigned to type and language finder taxonomies BUT NOT to category taxonomy so it is not found when filtering by this category.
Possible solution: add category taxomony in categories finder plugin.
For my test I copied code from content finder plugin to caegories finder plugin with minor changes and it works as expected now.
Copied code:
// Add the category taxonomy data.
$categories = $this->getApplication()->bootComponent('com_content')->getCategory(['published' => false, 'access' => false]);
$category = $categories->get($item->id);
// Category does not exist, stop here
if (!$category) {
return;
}
$item->addNestedTaxonomy('Category', $category, $this->translateState($category->published), $category->access, $category->language);

avatar pioada pioada - open - 14 Mar 2024
avatar pioada pioada - change - 14 Mar 2024
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 14 Mar 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 14 Mar 2024
avatar Hackwar Hackwar - change - 24 Mar 2024
Labels Added: bug
avatar Hackwar Hackwar - labeled - 24 Mar 2024
avatar Hackwar
Hackwar - comment - 6 Aug 2024

You are right, we would need a nested taxonomy entry for the categories. Would you be willing to make a pull request with the necessary changes? Please add it with an option as we have for other taxonomies, defaulting to off for now. ?

Add a Comment

Login with GitHub to post a comment