[4.0] Fix error 404 in modern routing for links without own menu item (NomenuRules)#20979
[4.0] Fix error 404 in modern routing for links without own menu item (NomenuRules)#20979csthomas wants to merge 2 commits intojoomla:4.0-devfrom
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 IDsis enabled then a link like:/index.php/en/component/content/article/article-en-gb?catid=8returns error 404In this PR I rewrote
NomenuRulesclass tobuildandparselinks:index.php/en/component/content/article/category-en-gb/article-en-gb(optionRemove IDsis enabled)index.php/en/component/content/article/3-category-en-gb/2-article-en-gbTesting Instructions
Disable all menu items for
com_contentcategories/category/articleviews.Go to frontend
index.php/component/content/categoriesand check links to category and article items.Expected result
Links work, no 404 when option
Remove Idsis enabled/disabled.Actual result
When option
Remove Idsis enabled then links to articles return error 404.