When cachin is turned on, cookie selection doesn't work.

Comments

Bladedu’s picture

This is because hook_init (where the cookie currently is set) is not invoked when cache is active for anonymous users. I think that the current hook_init implementation should be moved in language_cookie_language function and then apply a redirect in hook_boot (which is always called) to the correct language prefix (fetched from cookie) if the domain is called without language prefix.

alexweber’s picture

@Bladedu, thanks! You are absolutely right and I gotta admit I've never been very happy with the hook_init() method. I'll try to take a closer look and refactor soon.

In the meantime, patches are welcome! :)

alexweber’s picture

Status: Active » Fixed

I got around to it! :)

The current implementation feels more robust and has worked fine in my tests.

Committed in a7dd56a.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.