Default language not set when not using path prefix

Created on 24 November 2017, over 7 years ago
Updated 3 July 2025, 12 days ago

I have a site in English and French with English as the default language.

There is no path prefix for English. The path prefix for French is 'fr'.

The detection methods enabled are URL, Cookie and Default.

If the language cookie is set to 'fr' and English is chosen using the language switcher, the cookie is not overwritten.

<!--break-->

In the function _language_cookie_get_language() in language_cookie.module I modified

    if ($provider_id == LANGUAGE_COOKIE_NEGOTIATION) {
      return FALSE;
    }

to

    if ($provider_id == LANGUAGE_COOKIE_NEGOTIATION) {
      break;
    }

to ensure the cookie is overwritten with the default language.

🐛 Bug report
Status

Closed: outdated

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom wgsimon

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024