-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0] Fix error 404 in modern routing for links without own menu item (NomenuRules) #20979
Conversation
I have tested this item ✅ successfully on 7ba153e This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20979. |
Multilingual ###NOTE: Wanted to make a PR with this but as it is still broken, I will wait... Results Clicking on the category or parent category link in the infoblock gives correct results depending on the language of the category and its parent category. If any is set to ALL, the urls are real bad. I can get: If all set to the same Content Language, it will use my hidden All Categories Menu item (alias: Briefly said, when anything set to language ALL, sef links in 4.0 are badly broken, even after this patch. I also tested with a custom menu item to use instead of blog (With xml and all). @Hackwar Any idea? |
Solved here the issue with info-block and categories set to ALL languages. |
See #21916 concerning multilang |
Requiring a "hidden menu item" is not a real solution |
We have 2 issues, one is fixed by your PR another by this PR. Please do not mix it. |
@infograf768 Can you say that you have tested this PR? |
let me retest in present 4.0-dev + #22022 |
@csthomas Then using as url Now, if I use the module articles_category, it will display articles and I can click on their title link or their category link. After your PR, I get links like or with always the same Itemid=112 , which is the itemid of the Home page whatever the menu item displayed (a contact, a search, whatever) before clicking on the links in the articlescategory module. I never get the type of links you posted above before your patch I do indeed get 404s. Not sure I can set the test as successful. |
Probably J4 start to add an Itemid everywhere, but this is not job for this PR to fix it. IMO this Itemid is redundant. @Hackwar do you want to add something? |
@infograf768 Your test has been successful. J4 adds |
This here is a fix for a pretty obvious bug. As it is now ported to 4 it should be fine to be accepted as BC breaks can be tolerated. |
It may be hard to start as I have not found any tests on joomla routing. |
Idk where the tests are now, but I wrote full tests for all routing code... |
They were deleted at joomla/test-unit@f1a5ac8#diff-6862fb1e873b5617da1d3c4dc1447d2b |
Try https://github.com/joomla/test-integration (anyone got a map to actually find any of the tests anymore?) |
Thanks, I found. I see that I can use database in tests but I should not as @Hackwar mentioned in older PR. |
@wilsonge Should this be followed-up on? |
Can anybody pick this up or should we close this PR? |
I had the same issue as described in #32248. before patch: 404, after patch - the contat form is displayed with this url This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20979. |
Closing in favour of #32695 . |
Summary of Changes
This is a copy of #19280 without unit tests.
When there is no menu item for category/categories/article view in com_content and option
Remove IDs
is enabled then a link like:/index.php/en/component/content/article/article-en-gb?catid=8
returns error 404In this PR I rewrote
NomenuRules
class tobuild
andparse
links:index.php/en/component/content/article/category-en-gb/article-en-gb
(optionRemove IDs
is enabled)index.php/en/component/content/article/3-category-en-gb/2-article-en-gb
Testing Instructions
Disable all menu items for
com_content
categories/category/article
views.Go to frontend
index.php/component/content/categories
and check links to category and article items.Expected result
Links work, no 404 when option
Remove Ids
is enabled/disabled.Actual result
When option
Remove Ids
is enabled then links to articles return error 404.