-
-
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
Language switcher gets wrong URL in multi-lingual site with tags #20738
Labels
Comments
Confirm issue when Tags are used. |
I can confirm this too as I have this exact issue on two multilingual sites. |
I can confirm this tag URL issue is real on a multilingual site |
Status at Issue Tracker is "Discussion", so Issue is confirmed. Thanks for confirming. |
The issue is still present in april 2021. |
I have confirmed this is still an issue with Joomla 4. Please change the label to J4 on github |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to reproduce the issue
multilang_2018-06-13.zip

6. Click on `Kategorie blog` 7. You get the German category blog 8. Notice you now have a submenu called `Submenu kategorie` 9. Hover the mouse over the Dutch and English flag, you can see they link to the Dutch and English submenus e.g. `http://multilang.test/en/category-blog/submenu-category` rather than the Dutch and English menus associated with the German `Kategorie blog` which would be `http://multilang.test/en/category-blog`. 10. The same happens for other languages you get the main menu, the other flags will link to the submenu.What is going on here?

If you go to menus in the backend you will see this structure:
The same structure is there for Dutch and German. The parent menu is associated to the respective other parents. These parents are a
category blog
and the children link to exactly the same category with the difference being that the submenus have a tag filter applied.The association works fine just not the link building.
What I found out is that the code looks for the correct menu item but does not take into account the tag setting. So as it runs through the list of available items it always ends up with the last child that has the same link as the parent. In this example there is only 1 child but if you add 5 you will notice that the link always goes to submenu number 5.
The use case here is that you have an agenda category with 20 articles and related articles are grouped by tags. The parent shows all 20 items while the submenu show a subset of those 20 based on the applied tag.
I hope I have explained this in good enough detail.
Tagging @Hackwar as discussed
Expected result
The language flag has the correct URL.
Actual result
The language flag has the incorrect URL.
System information (as much as possible)
Joomla 3.8.8
PHP 7.1
MySQL 5.7
The text was updated successfully, but these errors were encountered: