-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
If the link is the same as active menu item then use it #18260
Conversation
This small patch should fix your issues and it has chance to be merged in J3.8.x than my previous one #17746 that won't be merged in J3.8 To test you have to replace only one file |
I have tested this item ✅ successfully on 94fae0c This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18260. |
// If the same view has two different menu items and one of them is active then use the active one | ||
return; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not seem to be enough, it will fail in cases of URLs that have id variable, because
$activeQuery['id'] is id
$query['id'] is id:alias
so the equality comparison will fail, but its should have succeed, right ?
@infograf768 |
Thanks @ggppdk @infograf768 PR #17746 after the last commit is broken for this test. I added a new commit. I tested an article with menu styles with success. |
At first sight, it was working OK, i.e. I got unique itemids for each of the menu items, even when clicking again on the same menu... but when clicking on the category link in the Article Info Category link, I get |
The problem was |
@csthomas Test: Login is done OK, but I get a notice: The Notice is the same in multilang whether the redirect is set to a |
In fact clicking directly on the |
TBH, I am a bit concerned about B/C here. |
There is still an issue with B/C now. |
Last commit solved the Notice for |
As I can not use |
|
What is the exact issue you have with category view? |
What I remarked (and I do not see how to solve that aspect except by a new parameter), is that
|
Joomla routing is not a simple path. Version for monolingual (If you do not use language parameter):
This is very weird but probably there ware some B/C issue. The code is at https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Component/Router/Rules/MenuRules.php#L206 - the trick one [Deleted] |
[Updated] It would be good to add new column/field "Routing Priority" to each menu item. This way we can manage which menu item (category menu) should be used for routing After that you can set higher priority for menu item 117. |
Going back to this PR,
I'm surprised that it works for category menus. |
I have tested this item ✅ successfully on 8740d71 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18260. |
@esedic can you please retest? |
I have tested this item ✅ successfully on 8740d71 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18260. |
RTC after two successful tests. |
Pull Request for Issue #17719 and #16774
Summary of Changes
If link Itemid is equal to active menu and link query is equal to active query then use it, do not try to find a better match.
Add unit tests to prove that.
Testing Instructions
Use tests from #17719 or #16774 or this below.
Expected result
Active second menu item (Style 2) should have URL to (Style 2)
Actual result
Active second menu item (Style 2) use first menu item URL (Style 1)
Documentation Changes Required
No