enable smart search content plugin
add category with subcategories
add articles with content to subcategories
create filter en select only subcategories (not the parent category)
add smart search module with that filter
search on frontend and result is as aspected
change filter and add parent category (do not unset the subcategories)
try to search, you havo no results
I expect to find the articles
No results
PHP 8.1.2
Joomla! 4.3.0
The problem is in components/com_finder/src/Model/SearchModel.php:getListQuery() row 201
// Iterate through each taxonomy group.
for ($i = 0, $c = count($groups); $i < $c; $i++) {
$query->having('SUM(CASE WHEN t.node_id IN (' . implode(',', $groups[$i]) . ') THEN 1 ELSE 0 END) > 0');
}
This result in een AND like this:
HAVING
SUM(CASE WHEN t.node_id IN (15) THEN 1 ELSE 0 END) > 0
AND SUM(CASE WHEN t.node_id IN (16,17) THEN 1 ELSE 0 END) > 0
AND SUM(CASE WHEN m.term_id IN (9) THEN 1 ELSE 0 END) > 0
But I think the AND must be an OR like this:
HAVING
(SUM(CASE WHEN t.node_id IN (15) THEN 1 ELSE 0 END) > 0
OR SUM(CASE WHEN t.node_id IN (16,17) THEN 1 ELSE 0 END) > 0)
AND SUM(CASE WHEN m.term_id IN (9) THEN 1 ELSE 0 END) > 0
The last AND with m.term is add in row 311 of the same file.
Labels |
Added:
No Code Attached Yet
|
Labels |
Added:
bug
|
pull request #39751 solves the problem. Thanks! This one can close.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-04-21 13:21:05 |
Closed_By | ⇒ | prinswebdevelopment |
Seems to be the same bug as described already here:
#38201
In my opinion the issue was set to "closed" by mistake.