The language dropdown works well without drupal caching.

The moment, drupal caching is turned on for anonymous users, the dropdown fails to switch language and keeps staying on the last visited language.

Steps to reproduce:

Turn on "Cache pages for anonymous users"
Turn on "Cache Blocks"

Once the cache builds, the language dropdown fails to switch from one language to another and keeps rendering the current language page one is in.

Thanks

Comments

manfer’s picture

Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)

I can't reproduce this. I have tested with the dev version but should work the same on 7.x-1.5. What is not supported is aggregate javascript nor aggregate CSS from performance configuration but the caches works fine.

manfer’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

Agregate works fine too. It was not working for me because server configuration needed a tweak.

About the cache makes no sense at all because the language switcher blocks have specific no cache configuration.

The issue you are facing must be related to something different as for example maybe a misconfiguration of language negotiation.

capogeannis’s picture

Status: Closed (works as designed) » Active

Did you get any solution for this? I have the same issue in my setup. As soon as I enable Anonymous Page Caching, the Language Switcher behaves exactly as described in this issue.

I can see the URL change and the page load for the language chosen, but all content on the page is the page you were last on. So... I have APC disabled so the switcher works. Would love to be able to enable it.

Interested to hear if you came across any solution. Thanks.

capogeannis’s picture

For me, this turned out to be related to domain based language negotiation failing due to a hardcoded base_url of .com in settings.php - which in turn affected the functionality of the Language Switcher Dropdown.

In my case, the simplest test was, and showing it wasn't the LSD's issue:

Fails: http://www.domain.cz

Works: http://www.domain.cz?nocache=1

The LSD was simply affected by this setting issue.

Changing my base_url config to the following allowed for the LSD to work now with APC enabled:

$base_url = $kprotocol.$_SERVER['HTTP_HOST'];

Cheers,
Ari