User tests: Successful: Unsuccessful:
The content component routers have a situation where they behave unintentional. When a category has a subcategory and a content item (for example an article) with the same ID and the "remove IDs" option is disabled, the router will choose the subcategory over the content item, regardless of the alias. This is because the router compares the current segment it processes against the available childcategories and only if that fails, it switches over to checking against the articles.
Up till now, the check only compared the leading ID of the segment and not the complete segment with ID AND alias. This PR changes that and tightens the comparison. This would fix the above mentioned issue and prevent broken URLs from working. That last part however is also the biggest issue. If people actually rely on broken URLs (for example pasting them into a field which actually isn't long enough for the pasted content.) this would break those URLs.
Unfortunately an automatic fallback is not possible. If we have this new behavior and then fall back on the old behavior when no match was made, we would end up at exactly the same point we are now. I also would strongly vote against adding another option for this, because I don't think we can convoy the function of such an option to our users. It would lead to some cargo cult behavior, I fear.
Since this is a potential backwards compatibility issue, I'm asking for a vote from the production department on this PR.
The article with the same ID is displayed.
The correct subcategory is displayed.
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
Category | ⇒ | Front End com_contact com_content com_newsfeeds |
Status | New | ⇒ | Pending |
So I went back through the old router and in this case we used to check the alias of article and category as the distinguishing factor
https://github.com/joomla/joomla-cms/blob/3.10-dev/components/com_content/helpers/legacyrouter.php#L352
https://github.com/joomla/joomla-cms/blob/3.10-dev/components/com_content/helpers/legacyrouter.php#L370
So I think actually PR is probably correct because it restores the previous behaviour.
Labels |
Added:
PR-4.3-dev
|
This PR was discussed in the Production Team meeting on 2023-02-07 and the decision was to close this PR, as the initial issue is very rare and can be fixed on a per-site-basis and the issue of lacking precision of the router is fixed by switching off the IDs in the components configuration. So the fix for this problem is to disable IDs in the URLs, as is done by default on new installations. At the same time, the fall out from simply doing this change in a release seems far to big to do it otherwise.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-02-07 18:33:49 |
Closed_By | ⇒ | Hackwar |
Will this remedy etc be documented?
Feel free to document it somewhere. I will not invest more time into this.
This is ridiculous. Any article with the same id as a category can’t be routed with legacy routing and this is the same behaviour as legacy routing in j3.
As this is a even worse b/c break I'm against it.