Skip to content
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

Open
roland-d opened this issue Jun 13, 2018 · 6 comments
Open

Language switcher gets wrong URL in multi-lingual site with tags #20738

roland-d opened this issue Jun 13, 2018 · 6 comments

Comments

@roland-d
Copy link
Contributor

roland-d commented Jun 13, 2018

Steps to reproduce the issue

  1. Install a clean Joomla site with database prefix jos_ (content does not matter as I provide an SQL dump)
  2. After installation replace the database with the attached SQL dump
    multilang_2018-06-13.zip
  3. You now have a multi-lingual site with 3 languages EN/DE/NL
  4. Go to the frontpage
  5. There you will see this menu and flags

image

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:
image

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

@infograf768
Copy link
Member

Confirm issue when Tags are used.

@hans2103
Copy link
Contributor

I can confirm this too as I have this exact issue on two multilingual sites.

@simontechdev
Copy link

I can confirm this tag URL issue is real on a multilingual site

@ghost
Copy link

ghost commented Jun 14, 2018

Status at Issue Tracker is "Discussion", so Issue is confirmed. Thanks for confirming.

@AC1982-git
Copy link

The issue is still present in april 2021.

@brianteeman
Copy link
Contributor

I have confirmed this is still an issue with Joomla 4.

Please change the label to J4 on github

@zero-24 zero-24 added J4 Issue and removed J3 Issue labels Aug 23, 2022
@crystalenka crystalenka moved this to Backlog in Issue Cleanup Oct 7, 2022
@crystalenka crystalenka moved this from Backlog to Still Relevant, Needs Attention in Issue Cleanup Oct 7, 2022
@Hackwar Hackwar added the bug label Feb 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Still Relevant, Needs Attention
Development

No branches or pull requests

9 participants