Skip to content
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

Multilingual websites: Issue with System - Page Cache #20594

Closed
Sandra97 opened this issue May 28, 2018 · 18 comments
Closed

Multilingual websites: Issue with System - Page Cache #20594

Sandra97 opened this issue May 28, 2018 · 18 comments

Comments

@Sandra97
Copy link

Sandra97 commented May 28, 2018

On multilingual websites, with the plugin System - Page Cache enable, when I navigate through a site in any language, and then click on the logo (or title of the site), I'm redirected to the homepage in the default language, instead of being redirected on the homepage in the active language.
It happens on all my multilingual websites (3.8.8), including joomla.org/3

Expected result

When clicking on the logo/title of the site, redirection to the homepage in the active language when the Plugin is enable

Actual result

When clicking on the logo/title of the site, redirection to the homepage in the default language instead of the active one when the Plugin is enable.
Issue solved by disabling the Plugin.

Additional comments

FYI, it occurs whether the router is set up on legacy or modern, with different templates and different PHP versions.

@brianteeman
Copy link
Contributor

Is this new behaviour. I would expect it to be always this way with the page cache plugin enabled.

@Sandra97
Copy link
Author

It was working correctly not that long ago on all my sites including the landing page. I'm unable to tell you right know when this issue appeared (after 3.8.7 or 3.8.8). I need to dig a bit for that.

@infograf768
Copy link
Member

infograf768 commented May 28, 2018

Which template are you using? The link in the logo/title may depend on the way it is coded.

@Sandra97
Copy link
Author

The official Joomla template (for the landing page), and templates from RocketTheme, YooTheme, JoomlArt.

@Sandra97
Copy link
Author

I did some tests from 3.8.2 to 3.8.8, with different templates. Seems it was already there in 3.8.2 but I didn't notice before. So it's maybe an (annoying) expected behaviour when the cache plugin is enabled. I just disabled it everywhere and now it's fine.

@mbabker
Copy link
Contributor

mbabker commented May 28, 2018

It's probably an issue of the order of plugins. If something matches what the page cache plugin has stored in the cache, it immediately serves that result and kills the Joomla application cycle. So in this case you probably need the page cache plugin ordered after the language plugins.

@infograf768
Copy link
Member

I tested the plugin by setting browser caching off and I did not get the issue

@Sandra97
Copy link
Author

@infograf768 On or Off for Browser caching doesn't change anything. I have the issue as soon as the plugin is enable.
@mbabker It doesn't seem to change anything, issue is still there.
Anyway, it's not my day! 😛

@mikeveeckmans
Copy link

i have the same issue as @Sandra97 described.

@hacki65
Copy link
Contributor

hacki65 commented May 29, 2018

I have made some tests on one of my multilanguage sites and found a possible solution. The system plugin "System - Language Filter" has an option named "Cookie Lifetime". If this option is set to "Year" all seems to be fine.

BUT: if i switch to a language, stay at the homepage and then click on a logo i will be redirect to the default language. If i call up a subsite (like www.my-domain.de/en/contact) a cookie will be set and all is good.

Seems to be this is a Session Cookie problem. If the option is set to "Year" Joomla! generate a seperate cookie for each language. Otherwise only 1 cookie will be set.

BTW: the ordering or cache plugin settings changed nothing.

@Sandra97
Copy link
Author

I just did some tests with 'Year' instead of 'session', I'm still redirected to the default language instead of the active one as long as Plugin - Page cache is enabled.

@ggppdk
Copy link
Contributor

ggppdk commented May 29, 2018

I'm redirected to the homepage in the default language

It is an issue but a bit different

One is not redirected to the "default language" instead of "active"
instead one is redirected to the language to which the language cookie was last set ...

If you visit a page that has already been cached by the System - Cache plugin,

  • then the code that checks if the language cookie needs to be updated does not get executed

The language filter plugin will do this during onAfterInitialise

public function onAfterInitialise()
{
...
		// Attach parse rules for language SEF.
		$router->attachParseRule(array($this, 'parseRule'), JRouter::PROCESS_DURING);
	}
}

but if a cached page is returned via System - Cache plugin, then
$this->parseRule() which will call $this->setLanguageCookie($lang_code);

is never executed, thus language cookie is not updated

@brianteeman
Copy link
Contributor

I am assuming that this is the same as the issue with #22099 so am closing it. If my assumption is wrong please post back and it can be reopened

@Sandra97
Copy link
Author

It's a different issue and it remains after applying the patch, so I still can't use the cache plugin on any multilingual sites.

@joomla-cms-bot
Copy link

Set to "open" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/20594

@ghost
Copy link

ghost commented Sep 10, 2018

reopened as stated above.


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

@franx47
Copy link

franx47 commented Nov 19, 2019

Using Joomla 3.9.13, the Language Switcher bug is still exist. I have the same problem on Bi-Lingual Site (English and non-english). Default language site is non-english. Everything is fine, menu item set to each of the language.

But, everytime I published the "System - Page Cache" plugin, it starts to get in problem.

Here is the Settings:

  • Use Browser Caching: No
  • Exclude Menu Items: (empty)

# ("System - Page Cache" plugin ENABLED)

  1. When the website open, it will redirect new visitor to the default language (non-english). Everything's fine.
  2. When the user change the default language (non english) to English, it will redirect the user to the English page. Everything's good.
  3. But when the user click the website logo or HOME menu, the site redirects back to the non-english page. Ofcourse this is incorrect. It still has to be in the English page.

I disabled the "System - Page Cache" plugin, the problem goes away.

Btw, "System - Page Cache" plugin has a good impact on Joomla page speed. Combined with JCH Optimize and System Cache (ON-Conservative).

Please, someone helps to patch this.

Thank you.

@brianteeman
Copy link
Contributor

Thank you for raising this issue.

Joomla 3 is now in security only mode with no further bug fixes or new features.

I have verified that this is resolved in Joomla 4 and this will now been closed.

cc @zero-24

@alikon alikon closed this as completed Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

10 participants