Repository navigation
[5.4] Fix Tags Menu URL Parameter Issue - #47638
Merged
Merged
Conversation
This was referenced May 21, 2026
Closed
Contributor
|
I have tested this item ✅ successfully on f61e729 Thank you @CSGoat0 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47638. |
|
I have tested this item ✅ successfully on f61e729 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47638. |
Contributor
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47638. |
Contributor
|
Final test before merge with JBT, 5.4.9-dev, MariaDB, PHP 8.5
|
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request resolves #40668.
Summary of Changes
This PR fixes a routing bug in
com_tagswhere thetypes[]parameter (content type filter) is incorrectly appended as a query string to SEF URLs instead of being properly absorbed by the router.Current problematic behavior: When a menu item of type "Tagged Items" has one or more content types selected (e.g., Article, Contact, News Feed), the
types[]parameters are appended to the URL as query strings.Examples of the bug:
/tags/exhibitions?types[0]=1/tags/exhibitions?types[0]=1&types[1]=2Solution: The router now compares the
types[]parameters in the URL against the content types configured in the menu item. If they match exactly, the parameters are removed from the URL since they are redundant (the menu item already stores this information). This follows the same pattern already used for comparing tag IDs in the router.Modified file:
components/com_tags/src/Service/Router.phpTesting Instructions
How to Replicate the Issue
Follow these steps on a fresh Joomla installation:
1. Enable SEF URLs
htaccess.txtto.htaccessif needed (or configure your local server environment)2. Create a tag
3. Create content items
4. Create the menu item
5. View the frontend
types[]parameter(s) appended:?types[0]=1?types[0]=1&types[1]=26. The workaround (demonstrates this is a bug)
Testing the Fix
Test Case 1: Single content type (Article only)
?types[0]=1Test Case 2: Multiple content types (Article + Contact)
?types[0]=1&types[1]=2Test Case 3: Different single content type (Contact only)
?types[0]=2Test Case 4: No content types selected (all types)
Test Case 5: User override (preserves intentional overrides)
https://mysite.com/tags/exhibitions?types[0]=1&types[1]=2Actual result BEFORE applying this Pull Request
Test Case 1 (Single type - Article):
Test Case 2 (Multiple types - Article + Contact):
Test Case 3 (Different single type - Contact only):
Test Case 4 (No types - all content types):
(This case already works correctly)
The
types[]parameters are appended as query strings regardless of how many content types are selected, making URLs unnecessarily long, less user-friendly, and inconsistent with Joomla's SEF URL patterns.Expected result AFTER applying this Pull Request
Test Case 1 (Single type - Article):
Test Case 2 (Multiple types - Article + Contact):
Test Case 3 (Different single type - Contact only):
Test Case 4 (No types - all content types):
Test Case 5 (User override - different from menu item):
(Preserved because user explicitly requested different content types)
All URLs are clean and free of redundant
types[]query parameters when they match the menu item's configuration. The content type filtering still works correctly because the menu item already stores this information in its parameters. User overrides are respected.Link to documentations
Please select: