[6.0] Multilingual: Fix language passed via lang variable is ignored#46810
[6.0] Multilingual: Fix language passed via lang variable is ignored#46810Bodge-IT merged 2 commits intojoomla:6.0-devfrom
Conversation
|
@joomdonation is it because my test website is in a subfolder that https://www.domain.com/_j6b2n/index.php?lang=fr - shows French version WITHOUT the PR applied while having the System - Language Filter plugin --> set Remove URL Language Code parameter to Yes or is it because I have the Language Filter settings set this way (beyond the Remove URL Language Code set to Yes I mean)
Thanks for the clarification :) |
|
Thanks @exlemor for testing. No, sub-folder is not effected because that happens on my local Joomla installation, too and I can clearly see the issue by code reading. It is strange that it is working OK on your test site. Just want to be sure, the site is a fresh Joomla 6 installation (because the issue only happens with Joomla 6, it works well on Joomla 5.4 and earlier) |
|
I have tested this item ✅ successfully on 130a29a This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46810. |
|
I have tested this item ✅ successfully on 130a29a This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46810. |
Hi @joomdonation, it is a Joomla 6 Nightly Site from the day before, and I just retested and it works without the PR applied. :/ |
That's strange because I can see the issue, both by actual test and code reading :). @Fedik @Hackwar You two worked on the most recent changes for the plugin, would be great if you could do a code review for this PR. Thanks. |
|
Hm, I do not see how this changes may work. The default joomla-cms/plugins/system/languagefilter/src/Extension/LanguageFilter.php Lines 381 to 385 in 25b1369 With your changes for URL with I did not tested, just looking the code. Maybe I missed something. |
For a none SEF URL like https://domain.com/index.php?option=com_name&task=do_something&lang=de for example, $sef is empty, so isset($this->sefs[$sef]) return false, so lang is not set in that block In my specific case, there is AJAX post request made to a none SEF url like above, the wrong language is use and cause wrong behavior. |
|
Okay, then it seems makes sense. |
Thanks |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46810. |
|
Thanks for the fix @joomdonation and thanks @mariantanase and @ceford for time offered for testing |
|
Thanks to all ! |

Pull Request for Issue # .
Summary of Changes
In Joomla 5.4 and earlier, language passed via lang variable is always used (takes highest priority) in language filter plugin (see https://github.com/joomla/joomla-cms/blob/5.4-dev/plugins/system/languagefilter/src/Extension/LanguageFilter.php#L412).
In Joomla 6.0, due to the change in this PR #43858, if Remove URL Language Code parameter set to Yes in System - Language Filter plugin, Joomla will use default language if it could not detect language from sef URL, not respect the language passed in lang variable when it is passed. This PR just fixes that wrong (backward incompatible) change.
Testing Instructions
Actual result BEFORE applying this Pull Request
Expected result AFTER applying this Pull Request
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed