Hi.
I am working on a multilingual site (eng, ita).
Everything works fine except the redirect after login.
I want the user who chooses the “ita” language to be redirected after login to the “ita” language article.
I want the user who chooses the “eng” language to be redirected after login to the “eng” language article.
Items 110 and 111 are the menu items for home “ita” and home “eng”.
In the login menu item index.php?option=com_users&view=login
if I choose the redirection type “internal URL” and specify index.php?Itemid=110
for language “ita” and index.php?Itemid=111
for language “eng” it works.
If I choose the redirection type “Menu item” and select the items (110 and 111) for “ita” and for “eng” it does not work: even with the “eng” language I am redirected to the “ita” item. It works instead if I point to the menu item for the general home (all languages).
I tried to choose for redirect other menu items linked to articles other than home... same result, it doesn't work.
Joomla! 5.1.3 stable
PHP 8.1.2
Apache/2.4.52
Labels |
Added:
No Code Attached Yet
|
Title |
|
It's a bug, not a site configuration problem.
After extensive testing with multiple Joomla developers and vendors, I can confirm this is a bug. Regardless of whether the login page or the login module is used, redirects consistently lead to the URL associated with the primary language. For example, setting a redirect to es/blog results in the user being redirected to en/blog.
This issue is critical for several of our clients, and they are willing to sponsor a fast-track solution. Please prioritize this and assign someone to investigate as soon as possible.
Thank you for your prompt attention to this matter.
We can also confirm that it is a redirection bug, specifically when using with associated menu items.
Labels |
Added:
bug
|
We can also confirm that there is a bug in the Joomla login functionality when using a multilingual site. The login module or component is incorrectly redirecting to a location associated with other languages. The redirect always goes to the default language of the site instead of taking into account the actual redirect settings from the component or module.
When logging in using the non-default login module (e.g., French), the user should be redirected to the French account menu (e.g., the French version of the Account Dashboard). Instead, the user should not be redirected to the English account menu.
Instead of redirecting to the French account menu, the user is redirected to the English account menu, regardless of the language of the login attempt.
Joomla 5.2.0
PHP Version: 8.2.22
DB: MySQL 8.0.39
We tested by removing the associations, and in that case, the redirects worked correctly.
Hi!
Any news on this issue?
I am developing a plugin and realized that with the return url passed on the login url I have the same problem.
I have a form with this action:
Route::_(index.php?option=com_users&task=user.login)
In the form I have the return url as a hidden field:
<input type=“hidden” name=“return” value=“<?php echo base64_encode($returnUrl) ; ?>” />
For the it-IT language the redirect to the return URL works.
For the en-GB language the redirect to the return URL does not work, I get redirected to the en-IT home page.
Thank you in advance for the response
Unfortunately, I cannot replicate the bug.
The user is redirected to the default language of the website after login as long as it is set in it's user profile (default setting).
As soon as the user changes their default language in their profile, they are also redirected to the selected language.
Perhaps there is a misunderstanding in the configuration. The settings in the user profile always have priority over the frontend language switcher.
You're right for login without any return url.
The issue was due to the user setting their language by forcing it-IT.
But the problem remains if you specify a return url from login.
If I am on an English page and have a login form that specifies the return url on that page, once I login I am sent back to the Italian home.
If I am on an Italian page, the return url on the page works perfectly.
I am trying to figure out if it depends on my code (given in the comment above), but it seems not.
Logging in the return url I saw that it is set correctly for both it-IT and en-GB languages, only for the former it works and for the latter it does not.
@LadySolveig Please follow the steps to reproduce the issue @protectkids posted above. This is definitely a bug. The redirection configured in the Joomla Login Component or Module should function as set; otherwise, it defeats the purpose of the feature.
I understand your perspective on the user's default language setting, but this should have no bearing on the redirect function in the login menu—or any other type of redirect, regardless of how it is triggered. Whether the redirection is set via the login module, a menu item, a system plugin, or any other function, it should always lead to the intended destination. Allowing the user's language setting to interfere with redirection logic introduces inconsistency and unpredictability, which undermines site navigation and user experience.
As @sousa9g noted, this issue occurs specifically when using associated menu items. This should not happen, as associated menus in a multilingual setup are meant to ensure seamless navigation by linking equivalent pages across languages. If the redirect ignores these associations, it disrupts expected behavior and makes multilingual navigation unreliable.
@MayaSima I have followed the testing instructions and summarised my findings above. Unfortunately, I can't say any more. 🤷🏼
But I think it should be possible to bypass the default behaviour by entering the ‘internal url’ as mentioned by @luX0r-reload directly, possibly even in combination with the corresponding language parameter &lang=<lang-code>
if you want to be on the safe side under all circumstances.
But I have not tested this explicitly.
The standard is that Joomla respects and prioritises the setting in the user profile for the frontend language and tries to switch to this language accordingly after login.
Additional comments
We tested by removing the associations, and in that case, the redirects worked correctly.
If the association is not set, no suitable entry is found and the redirect is resolved as set.
This is also the default behaviour.
But of course I can't rule out the possibility that I'm simply misunderstanding something here.
@luX0r-reload What you can try in your own code is to get the language the user comes from and then explicitly add the &lang=<lang-code>
parameter to the return url.
@LadySolveig I have already tried. Nothing changes. The return URL is correct both with and without lang parameter.
It is when the post on "user.login" happens that the wrong return url is set in the http header.
Thank you for detailed info @luX0r-reload I will try to set this up again as soon as I find the time and will come back to you then. Thank you for your patience.
Have you asked in the forum?