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
Regression: Multilingual com_tags getting wrong language cookie #17084
Conversation
Another solution (which would not touch at the helpers) is to use specifically for com_tags, every time we have a What do you think? |
libraries/cms/helper/content.php
Outdated
if (JLanguageMultilang::isEnabled()) | ||
{ | ||
$plugin = JPluginHelper::getPlugin('system', 'languagefilter'); | ||
$pluginParams = new JRegistry($plugin->params); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New Registry + namespace load here please :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this pr is in the 3.7.x branch do we need to namespace in 3.7.x too ???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registry has been namespaced since 3.4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
me not know how to, but if I am asked to use the other solution, this would anyway be obsolete.
@mbabker please let me know your thought
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the namespacing thing, look at any other file which has a use Joomla\Registry\Registry;
statement, copy that into the same place, and change JRegistry
to Registry
.
libraries/cms/helper/helper.php
Outdated
if (JLanguageMultilang::isEnabled()) | ||
{ | ||
$plugin = JPluginHelper::getPlugin('system', 'languagefilter'); | ||
$pluginParams = new JRegistry($plugin->params); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
I honestly don't know what the purpose of |
Namespacing done. |
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. |
I have tested this item ✅ successfully on 3a4ad0a This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17084. |
I have tested this item ✅ successfully on 3a4ad0a This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17084. |
Thanks JM This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17084. |
Pull Request for Issue #17053
Summary of Changes
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
Testing Instructions
See details in #17053
Set the languagefilter
Cookie lifetime
toSession
: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 toCurrent
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.
@mino182
@tonypartridge