? Success

User tests: Successful: Unsuccessful:

avatar andrepereiradasilva
andrepereiradasilva
16 Jul 2016

Pull Request for Issue #11159 and #11143.

Summary of Changes

Adds HTTP headers to not cache in browsers the language filter plugin 301 redirect.

The problem was created by #8894.

Testing Instructions

See #11159 and #11143.

pinging @infograf768 and @ggppdk

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
1.00

avatar andrepereiradasilva andrepereiradasilva - open - 16 Jul 2016
avatar andrepereiradasilva andrepereiradasilva - change - 16 Jul 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 16 Jul 2016
Labels Added: ?
avatar andrepereiradasilva andrepereiradasilva - change - 16 Jul 2016
The description was changed
avatar andrepereiradasilva andrepereiradasilva - change - 16 Jul 2016
The description was changed
avatar andrepereiradasilva andrepereiradasilva - change - 16 Jul 2016
The description was changed
avatar ggppdk
ggppdk - comment - 16 Jul 2016

Confirmed that in both cases the 301 redirect for home-page without language code

  • is not cached for browsers: chrome, firefox, edge

Issue #11159 ("Remove language code" for default language is ON (lang-filter plugin))

  • language switching for all languages while in home page is now possible
  • type or click the home page without language code then he will get the default language without any redirect

This is expected and correct behaviour according to configuration ! (also if you see the language switcher URL you will see that default language does not have language code)

Issue #11143 ("Remove language code" for default language URL is OFF (lang-filter plugin))

  • type or click the home page url without language code, you are redirected to home-page URL with language code of the last switched language

Please test without cache / page cache, or clean cache after every configuration change of language filter plugin

avatar ggppdk ggppdk - test_item - 16 Jul 2016 - Tested successfully
avatar ggppdk
ggppdk - comment - 16 Jul 2016

I have tested this item successfully on 963c58c

Works, see my previous comment, note i tested in browsers (firefox, chrome, edge, IE)

NOTE: if you don't see the 301 redirect in network console when clicking on URL that is supposed to do 301 redirect, it is because some browser clear their console on new page load, and if localhost it may update too fast to see it


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11161.

avatar dgt41 dgt41 - test_item - 16 Jul 2016 - Tested successfully
avatar dgt41
dgt41 - comment - 16 Jul 2016

I have tested this item successfully on 963c58c


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11161.

avatar ggppdk
ggppdk - comment - 16 Jul 2016

at least 1 more tester for this ?

avatar Handy84
Handy84 - comment - 17 Jul 2016

I have tested this item successfully on 963c58c

avatar infograf768 infograf768 - test_item - 17 Jul 2016 - Tested successfully
avatar infograf768
infograf768 - comment - 17 Jul 2016

I have tested this item successfully on 963c58c


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11161.

avatar joomla-cms-bot joomla-cms-bot - change - 17 Jul 2016
Title
REGRESSION: [language filter plugin] 301 redirect without caching in browser
[language filter plugin] 301 redirect without caching in browser
avatar infograf768 infograf768 - change - 17 Jul 2016
Title
[language filter plugin] 301 redirect without caching in browser
REGRESSION: [language filter plugin] 301 redirect without caching in browser
Status Pending Ready to Commit
avatar joomla-cms-bot joomla-cms-bot - change - 17 Jul 2016
Title
[language filter plugin] 301 redirect without caching in browser
REGRESSION: [language filter plugin] 301 redirect without caching in browser
avatar infograf768
infograf768 - comment - 17 Jul 2016

RTC and changed Title to add Regression. Thanks!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11161.

avatar joomla-cms-bot joomla-cms-bot - change - 17 Jul 2016
Title
[language filter plugin] 301 redirect without caching in browser
REGRESSION: [language filter plugin] 301 redirect without caching in browser
Labels Added: ?
avatar infograf768
infograf768 - comment - 17 Jul 2016

@wilsonge
Please get into 3.6.1

avatar infograf768 infograf768 - change - 17 Jul 2016
Status Ready to Commit Pending
avatar infograf768
infograf768 - comment - 17 Jul 2016

Changing back to pending. I have issues here in Firefox when browser caching enabled (for Home page). Can't switch to default language (en-GB here).


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11161.

avatar joomla-cms-bot joomla-cms-bot - change - 17 Jul 2016
Labels Removed: ?
avatar infograf768
infograf768 - comment - 17 Jul 2016

Folks, please test reverting
#10344

It solved the issue here.

avatar ggppdk
ggppdk - comment - 17 Jul 2016

@infograf768

Web-sites will not (at least they should not) change settings after initial setup for

  • language filter plugin parameter "remove language code"
  • system cache plugin parameter "browser cache"

Otherwise the 301 etc instructions to the visitor browsers are no longer valid, and its not possible to force browser to clean cache for a specific URL that the browser does not resend to the server, but instead retrieves it from the cache

if you clear both Joomla cache and browser cache then it should work ?

  • i tested and it works, maybe you can give more detailed instructions

at least for me it worked (i cleared browser cache and Joomla cache after changing settings of the plugins)

avatar infograf768
infograf768 - comment - 17 Jul 2016

@ggppdk
Yep, I know a bit how it should work. :)
I was successful when my Firefox had cache enabled when both:
Reverting #10344
Applying this patch

avatar ggppdk
ggppdk - comment - 17 Jul 2016

hhhmm i have it applied,

and i saw the effect you describe (when i had SEF off),

  • but it worked after i cleaned cache in chrome,

later "today" i will retest with firefox and other browsers

avatar infograf768 infograf768 - test_item - 17 Jul 2016 - Tested unsuccessfully
avatar infograf768
infograf768 - comment - 17 Jul 2016

I have tested this item ? unsuccessfully on 963c58c


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11161.

avatar brianteeman brianteeman - change - 17 Jul 2016
Category Multilanguage Plugins
avatar chrisdavenport
chrisdavenport - comment - 17 Jul 2016

Why are we using a 301 here? 301 is a permanent redirect. By telling caches not to cache a 301 you're effectively trying to convert it to a temporary redirect. But there is already a 302 redirect for exactly that purpose. Telling caches not to cache a 302 makes perfect sense and you might have less trouble with caches as a result.

avatar ggppdk
ggppdk - comment - 17 Jul 2016

@chrisdavenport

301, was decided to be re-applied, after some discussion for SEO reasons, in this PR
#8894

I am not 100% sure it is worth it,
but possibly 301 with zero expired time is the best choice ?

and then this PR is does the above, to fix problems related with 301 redirect
and it seems to almost succeed,

i will test the reported conflict of this fix with #10344

avatar chrisdavenport
chrisdavenport - comment - 17 Jul 2016

#8894 changed it from the default 303 to 301. As @andrepereiradasilva pointed out, this changed the semantics to that of a permanent redirect, which you're now trying to override by adding cache directives instead of using the correct, temporary redirect in the first place.

303 will lead to duplicate content on search engines because, as the specification says, "the new URI in the Location header field is not considered equivalent to the effective request URI." (https://tools.ietf.org/html/rfc7231#section-6.4.4)

Adding the cache directives is good, but the status code should be changed too, in my opinion.

avatar 01Kuzma
01Kuzma - comment - 17 Jul 2016

Which files are patched? If I change only the plugins/system/languagefilter/languagefilter.php Joomla doesn't load content at all.
When I could download the upgrade?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11161.

avatar andrepereiradasilva
andrepereiradasilva - comment - 17 Jul 2016

i agree with @chrisdavenport . i'm not enterily in favour of a "301 Permanent Redirect" in the language filter redirect as i explained in the original PR that made that change #8894. Probably a "302 Found" is the correct awnser for this.

This PR only propose is to send HTTP headers for browsers to not cache language filter HTTP redirects (independently of the HTTP redirect type), doesn't changes the redirect HTTP status code type.

avatar andrepereiradasilva andrepereiradasilva - change - 17 Jul 2016
The description was changed
avatar Sandra97 Sandra97 - test_item - 17 Jul 2016 - Tested unsuccessfully
avatar Sandra97
Sandra97 - comment - 17 Jul 2016

I have tested this item ? unsuccessfully on 963c58c

Able to reproduce the issue, I tested manually the patch, unsuccesfully.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11161.

avatar andrepereiradasilva
andrepereiradasilva - comment - 17 Jul 2016

@Sandra97 did you cleared the cookies and browser cache, or used a new private browser window for testing?

avatar Sandra97
Sandra97 - comment - 17 Jul 2016

@andrepereiradasilva, I cleared the cookies and browser cache, tried with private browser and 2 different browsers but no change:
joomla 3 6 - joomla 3 6 - ultime caratteristiche 2016-07-17 08-00-29
And all the menu items are now /it, some of the content displayed is in italian and some is english. If I revert the change, the display is ok, everything is nearly ok except of course that I can't display the default homepage in the right language

avatar andrepereiradasilva
andrepereiradasilva - comment - 17 Jul 2016

are you using todays latest staging?

remember a patch #10344 was merged yesterday that changes the same file. so, if you're not using latest staging, when using the patchtester, and since the patchtester replaces the entire file, applying this PR will include the changes from the merged PR in this file too and will break things.

So please try use latest staging + patchtester or try apply just the lines of code this PR changes manually, ie, without the patchtester: https://github.com/joomla/joomla-cms/pull/11161/files

avatar Sandra97
Sandra97 - comment - 17 Jul 2016

I did the test by replacing manually the current content of the file by yours (whole content)

avatar andrepereiradasilva
andrepereiradasilva - comment - 17 Jul 2016

I did the test by replacing manually the current content of the file by yours (whole content)

You can't. that's what i'm saying, if you're not using the latest staging please add just the lines of code this PR adds. Don't replace the whole file nor use the patchtester.

avatar Sandra97
Sandra97 - comment - 17 Jul 2016

Ok, I'll try like this.

avatar Sandra97 Sandra97 - test_item - 17 Jul 2016 - Tested successfully
avatar Sandra97
Sandra97 - comment - 17 Jul 2016

I have tested this item successfully on 963c58c

Adding only the new lines to the file does the job. I'm now able to browse the default homepage.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11161.

avatar andrepereiradasilva
andrepereiradasilva - comment - 17 Jul 2016

thanks @Sandra97

@infograf768 @ggppdk and other testers.

To test:

  • clean cookies and browser cache before testing OR use new private browser window.
  • and use latest staging from today + patch tester OR apply the patch manually by changing just the lines this patch changes (see https://github.com/joomla/joomla-cms/pull/11161/files).
avatar infograf768
infograf768 - comment - 17 Jul 2016

@andrepereiradasilva
i tested on the latest staging with 10344. browser cache on and cleaned(which i don't do usually). no jomla cache. cookies cleared.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11161.

avatar andrepereiradasilva
andrepereiradasilva - comment - 17 Jul 2016

ok then try without 10344 applied, because this PR just tells the browser to not cache the redirect, nothing more.

avatar infograf768
infograf768 - comment - 17 Jul 2016

As I said, to get it to work, I reverted 10344 and then applied your patch. And then it works here.

avatar andrepereiradasilva
andrepereiradasilva - comment - 17 Jul 2016

then change your test to success please

avatar infograf768
infograf768 - comment - 17 Jul 2016

I can't as #10344 is in the way for me here.

avatar mbabker
mbabker - comment - 17 Jul 2016

The fact that 10344 needs to be reverted for this to work tells me that the plugin's constructor is doing more than setting application values, which is exactly what that pull request removed from the plugin to force the event dispatcher to correctly respect the configured plugin ordering values. This also tells me that parts of the languagefilter plugin should NOT be the plugin but integrated directly into the application class because there is an extremely tight coupling to its constructor logic from within the application and this should NEVER be the case.

avatar infograf768
infograf768 - comment - 17 Jul 2016

@mbabker

I tested again after quitting Firefox and relaunching.
I don't have the issue anymore after this patch. Means I do not have anymore to revert 10344
I have the feeling my problem was due to sessions (not cookies).

avatar mbabker
mbabker - comment - 17 Jul 2016

Well, that's a good sign.

avatar infograf768 infograf768 - test_item - 17 Jul 2016 - Tested successfully
avatar infograf768
infograf768 - comment - 17 Jul 2016

I have tested this item successfully on 963c58c


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11161.

avatar infograf768 infograf768 - change - 17 Jul 2016
Status Pending Ready to Commit
avatar infograf768
infograf768 - comment - 17 Jul 2016

RTc again.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11161.

avatar joomla-cms-bot joomla-cms-bot - change - 17 Jul 2016
Labels Added: ?
avatar wilsonge wilsonge - change - 17 Jul 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-07-17 16:23:42
Closed_By wilsonge
avatar wilsonge wilsonge - close - 17 Jul 2016
avatar wilsonge wilsonge - merge - 17 Jul 2016
avatar joomla-cms-bot joomla-cms-bot - close - 17 Jul 2016
avatar wilsonge wilsonge - reference | df34366 - 17 Jul 16
avatar wilsonge wilsonge - merge - 17 Jul 2016
avatar wilsonge wilsonge - close - 17 Jul 2016
avatar wilsonge wilsonge - change - 17 Jul 2016
Milestone Added:
avatar joomla-cms-bot joomla-cms-bot - change - 17 Jul 2016
Labels Removed: ?
avatar andrepereiradasilva andrepereiradasilva - head_ref_deleted - 17 Jul 2016
avatar ggppdk
ggppdk - comment - 17 Jul 2016

@andrepereiradasilva
@infograf768

please read, or may i should open another issue

this patch seems good after cache clearing but there is another issue

I have site with default language e.g. "French"

1- if current language is French and i visit domain/ i get no redirection
2- if current language is German and i visit domain/ i get a 301 redirection to domain/de/
3- if current language is English and i visit domain/ i get a 301 redirection to domain/en/
4- if i visit domain/fr/ i get a 301 redirection to domain/

1 and 4 are good
2 and 3 the redirection are OK , but they must not have code 301 ! , right ?

[EDIT]
example of URL inside the page that has no language code is the logo image

avatar ggppdk
ggppdk - comment - 17 Jul 2016

Different issue, i will open new issue

avatar Bakual
Bakual - comment - 17 Jul 2016

Imho, 301 is indeed the wrong redirect as the origin URL is still valid. It hasn't moved permanently. It's only temporary or "see other". So 302 or 303 are the appropriate redirects.
On a sidenote: google.com redirects using a 302 to the localised country domain (eg google.ch).

avatar nelgin
nelgin - comment - 26 Jul 2016

I've been tearing my hair out trying to figure what I may have changed to cause the language to get stuck. I applied the patch, learned Joomla and browser cache and now it seems to be functioning as it should be.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11161.

Add a Comment

Login with GitHub to post a comment