?
Referenced as Pull Request for: # 6230
avatar pieter-groeneweg
pieter-groeneweg
27 Feb 2015

read: http://forum.joomla.org/viewtopic.php?f=711&t=874852&p=3272103#p3272103

I did a quick test.

When selecting a language (en), cookie is set in path /en/ with value "en-GB" expiration this date next year.

When returning to the site, the language shown is dutch (nl).. Not even by choice of language default as "en" is set as default.

Votes

# of Users Experiencing Issue
0/1
Average Importance Score
3.00

avatar pieter-groeneweg pieter-groeneweg - open - 27 Feb 2015
avatar joomla-cms-bot joomla-cms-bot - change - 27 Feb 2015
Labels Added: ?
avatar engelweb
engelweb - comment - 27 Feb 2015

I believe we're experiencing the same issue with our site; after updating, Joomla 3.4 seems to default to system language/browser language (depending on the setting of the language filter), completly ignoring the stored value in the cookie.

We noticed becuase it affects all SEF URL's not containing a language segment on our site.
Any URL like "example.com/pages" missing the language (ex. /en/) will automatically redirect to the default of the filter now, rather than checking with the cookie to retrive the current language.

In the previous version of Joomla, this was not an issue.

avatar zero-24 zero-24 - change - 27 Feb 2015
Status New Confirmed
avatar zero-24 zero-24 - change - 27 Feb 2015
Category Multilanguage Plugins
avatar pekollik
pekollik - comment - 27 Feb 2015

I am running Joomla! 3.4.0 at localhost and I was not able to reproduce the issue. I installed dutch language packet, changed default language both for Site and Administrator back and forth between En and NL couple of time and everything was ok.

avatar pieter-groeneweg
pieter-groeneweg - comment - 27 Feb 2015

Aha, yes indeed... it listens to the browser preference...

...but NOT to the cookie....

avatar infograf768
infograf768 - comment - 28 Feb 2015

I confirm the regression.
The cookie is saved indeed, but when we load the url without languagecode it does not redirect to the last language used but to the default site language, whatver the settings for a new visitor (which the user is not, as a cookie exists).
this happens when "Remove URL Language Code" is set to Yes

avatar Hackwar
Hackwar - comment - 28 Feb 2015

@engelweb What you are describing is expected behavior. The cookie should never change the URL, but only hint which language you want. Since we don't want duplicate content, you can only remove the language code from the URL for the default language of the site, not of the specific user.

avatar infograf768
infograf768 - comment - 28 Feb 2015

@Hackwar
what I describe is unwanted behaviour.
The cookie should be used, even when "Remove URL Language Code" is set to Yes

avatar davdebcom
davdebcom - comment - 28 Feb 2015

There is no discussion possible about whether it should work this way or not, because it used to work this way. It is a backwards compatibility issue that needs to be fixed, because the project decided that in the 3.x upgrades there would be no BC incompatible changes.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6213.
avatar brianteeman
brianteeman - comment - 28 Feb 2015

Agreed - this is a B/C change that needs to be fixed


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6213.
avatar Hackwar
Hackwar - comment - 28 Feb 2015

I don't see anybody denying that. I simply said that the behavior that @engelweb!! experiences is the expected behavior. Or does anybody claim that it would be ok to get dutch or english content under the exact same URL simply based on a cookie?

avatar HermanPeeren
HermanPeeren - comment - 28 Feb 2015

When english is the default language, but the cookie says dutch was last used, then the url should be redirected to the dutch url.

Now https://github.com/joomla/joomla-cms/blob/staging/plugins/system/languagefilter/languagefilter.php#L241-L247 just take the default site language without looking at the cookie.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6213.
avatar davdebcom
davdebcom - comment - 28 Feb 2015

Exactly, what @HermanPeeren says.
When english is the default language, but the cookie says dutch was last used, then the url should be redirected to the dutch url.

Of course with a correct redirect, not 301 but 303?

avatar Bakual Bakual - close - 28 Feb 2015
avatar Bakual
Bakual - comment - 28 Feb 2015

Closing this since Hannes did a PR #6230.
Please test so we can fix this in staging. Thanks all!

avatar Bakual Bakual - change - 28 Feb 2015
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2015-02-28 14:37:40
avatar Bakual Bakual - close - 28 Feb 2015
avatar HermanPeeren
HermanPeeren - comment - 1 Mar 2015

This should be reopened as #6230 is closed now and this issue not yet solved. Working on a PR.

avatar Bakual Bakual - change - 1 Mar 2015
Status Closed New
avatar Bakual Bakual - reopen - 1 Mar 2015
avatar Bakual
Bakual - comment - 1 Mar 2015

Agreed

avatar Bakual Bakual - reopen - 1 Mar 2015
avatar infograf768
infograf768 - comment - 2 Mar 2015

Found another issue:
http://forum.joomla.org/viewtopic.php?f=711&t=875100

Folks, I wonder now if we should not simply revert the original PR.

avatar engelweb
engelweb - comment - 2 Mar 2015

Sorry for this late reply, but I forgot a detail in my previous description of my case, which seem to have possibly caused a bit of confusion.

In the case I described earlier in this issue, the URLs are supposed to contain the language string, ex. "example.com/en/".
The problem occurs if I have a link in ex. a "Custom HTML" module which links to an address without the language code included.
Upon clicking said link, it will then redirect me to the default language and add it to the URL (ex. /en/), rather than the language stored in the cookie (ex. /nl/).
In the previous version, the Joomla would detect the lack of language segment, then search the cookie for the current language in order to put it back in and direct you to the correct page, rather than simply throw you back to the default.

If this is the new expected behavior, then I find that quite bothersome, since it's a "feature" that we have been taking advantage of in pretty much all our projects.

Either way, I hope that clearifies things a bit.
Other than that, it's good to see so many people actively working figuring out the problem.
Keep up the good work everyone!

avatar HermanPeeren
HermanPeeren - comment - 2 Mar 2015

Main lesson: better, more systematically testing before commiting.

I think we only have some minor cases left now. Unfortunately today I have to work first, but hope to finish my PR tonight and it solves this issue. It took some more time because I want to get the code cleaner; easier to reason about.

Hannes' #5140 PR was a very good and necessary step in cleaning up the code-mess in the original languagefilter-plugin, that might have worked but was unmaintainable. The other, menu-item-alias issue, is probably not related to the languagefilter-plugin, see #6254. 'Simply' reverting a possibly related PR could cause other issues and could be counter-productive.

avatar Hackwar
Hackwar - comment - 2 Mar 2015

The menu alias is fixed with #6254

Regarding issues with language: There is quite a bit more cruft in JApplicationSite::initialiseApp(). Most of those checks there are unnecessary and quite a bit of those checks never evaluate to true. If the project is interested in cleaning up old code, that would be the next area to work on to improve the language system.

avatar infograf768
infograf768 - comment - 2 Mar 2015

#6254 does not solve the menu item alias here, or, rather, introduces other error. See PR.

avatar infograf768
infograf768 - comment - 9 Mar 2015

New #6254 and #6278 solve Falang, Virtuemart and menu item alias issues.

Just remains to solve this cookie one to be fine for 3.4.1

avatar Bakual
Bakual - comment - 9 Mar 2015

Hannes did another attemp of solving this. Can you guys please test #6371?

avatar infograf768 infograf768 - change - 9 Mar 2015
Priority Medium Urgent
avatar rdeutz
rdeutz - comment - 20 Mar 2015

Problem fixed with #6452 so closing this one

avatar rdeutz rdeutz - change - 20 Mar 2015
Status New Closed
Closed_Date 2015-02-28 14:37:40 2015-03-20 12:25:11
avatar rdeutz rdeutz - close - 20 Mar 2015

Add a Comment

Login with GitHub to post a comment