User tests: Successful: Unsuccessful:
Pull Request for Issue #17053
JHelper and JHelperContent do not take into account both ways of setting a lang cookie by the languagefilter plugin.
If the setting is to a year, the cookie is stored separately.
If the setting is set to Session, it is set in the session cookie (this was introduced in #12306 )
com_tags (and possibly some 3rd party extensions) use these classes to display the tags when the parameter is set to use current_language
See details in #17053
Set the languagefilter Cookie lifetime
to Session
:
for the following demo, I have created a single tag Mystag
.
I have assigned it to the article Another article french
tagged to French (fr-FR)
Also to to the article newarticle english
tagged to English (en-GB)
And to the article myarticle
tagged to ALL content languages.
Create a Tagged Items
menu item to display that single tag and make sure Language Filter is set to Current
When switching languages, that menu item will now correctly display 2 articles, one set to the Content Language in use, the other set to ALL content languages.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
I honestly don't know what the purpose of JHelperContent::getCurrentLanguage()
is (remember I really don't do multilingual stuff and the sites that I have it on it's all managed by others). The one thing I think seems a little off though is https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/helper/content.php#L159 using the default configured language for the site versus using the active language from JFactory
.
Labels |
Added:
?
|
Namespacing done.
The one thing I think seems a little off though is https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/helper/content.php#L159 using the default configured language for the site versus using the active language from JFactory.
As this is an urgent PR for 3.7.4, I guess it is better, in case we keep modifying the helpers, to leave the rest of the code alone.
Priority | Medium | ⇒ | Urgent |
I have tested this item
Patch ok for me
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
Thanks JM
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-07-17 08:51:20 |
Closed_By | ⇒ | rdeutz | |
Labels |
Added:
?
|
Another solution (which would not touch at the helpers) is to use specifically for com_tags, every time we have a
current_language
conditional (therefore including the tags modules),JFactory: :getApplication()->getLanguage()->getTag();
instead ofJHelperContent::getCurrentLanguage()
@mbabker
@rdeutz
What do you think?