User tests: Successful: Unsuccessful:
Pull Request resolves #43627
Removed the condition && $includeChildren != 1 from the HAVING clause check in TagsHelper::getTagItemsQuery().
File changed: libraries/src/Helper/TagsHelper.php (line 418)
Before:
if ($ntagsr > 1 && $anyOrAll != 1 && $includeChildren != 1) {After:
if ($ntagsr > 1 && $anyOrAll != 1) {This change allows the "Match All" setting to work correctly when "Include Child Tags" is enabled. Previously, the HAVING clause was skipped entirely when child tags were included, causing the query to default to "Match Any" behavior.
Step 1: Create test tags
Step 2: Create test articles
Navigate to Content → Articles
Create the following three articles:
| Article Title | Tags to assign |
|---|---|
| Article 1 | Only Tag A (Fruits) |
| Article 2 | Tag A (Fruits) AND Tag B (Vegetables) |
| Article 3 | Only Tag B (Vegetables) |
For each article, click Save & Close
Step 3: Create the menu item
Step 4: Test on the frontend
Only Article 2 appears (the article that has both Tag A and Tag B)
When "Match Type: All" and "Child Tags: Include" are both selected with two or more tags:
When "Match Type: All" and "Child Tags: Include" are both selected with two or more tags:
To verify that the fix works correctly with child tags, please run the following additional tests using the same menu item (keep "Match Type: All" and "Child Tags: Include" selected):
Test 1: Replace Tag A (e.g., "Fruits") with one of its children, e.g., "Apples". Keep Tag B as "Vegetables".
Expected result: Same as before — only Article 2 appears (because Article 2 has both "Apples" from Tag A's family and "Vegetables" from Tag B's family).
Test 2: Replace Tag B (e.g., "Vegetables") with one of its children, e.g., "Carrots". Keep Tag A as "Fruits".
Expected result: Same as before — only Article 2 appears (because Article 2 has both "Fruits" from Tag A's family and "Carrots" from Tag B's family).
Test 3: Replace Tag A (e.g., "Fruits") with one of its children, e.g., "Apples", AND replace Tag B (e.g., "Vegetables") with one of its children, e.g., "Carrots".
Expected result: Same as before — only Article 2 appears (because Article 2 has both "Apples" from Tag A's family and "Carrots" from Tag B's family).
Test 4: Replace only one tag (either Tag A or Tag B) with a child tag, and ensure the other tag is NOT present in any article.
Expected result: No articles appear (because no article has tags from both families).
These tests confirm that the "Match All" logic correctly follows tag hierarchies when child tags are included, regardless of whether the selected tags are parents or children.
Link to documentations
Please select:
| Status | New | ⇒ | Pending |
| Category | ⇒ | Libraries |
| Labels |
Added:
PR-5.4-dev
|
||
Tested successfully on 5.4.5 with Patchtester
Tested successfully on 5.4.5 with Patchtester
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47742.
@MacJoom Have you used the blue "Test this" button in the issue tracker? It seems your test was not counted. See https://issues.joomla.org/tracker/joomla-cms/47742 .
I have tested this item ✅ successfully on 3d9fc3b
I have tested this item ✅ successfully on 3d9fc3b
Tested successfully on 5.4.5 with Patchtester
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47742.