Lanuage negotiation notice: undefined index in getLangcode

Created on 19 December 2018, over 6 years ago
Updated 10 March 2025, 3 months ago

When makes changes to the languages (more specificially changing the language negotiation) in Drupal 8.6.2 I'm getting multiple notices. Check out the screenshot for the error.

This is an error after using the Drupal 8.6.2 environment for a couple of weeks. This means the error could happen for a variety of reasons.
The fix I'm proposing is a simple check for the index, which is mostly harmless, but will remove the notice.

🐛 Bug report
Status

Closed: outdated

Version

9.4

Component

language.module

Created by

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.

  • 🇬🇧United Kingdom Rory Downes

    Hi,
    I have seen this issue with a Drupal 10.4.3 site. I don't have the domain module. It happens when I add a language and Drupal is going through the batch process of adding translations.

    I also tried it on a vanilla Drupal site (10.4.4) with just admin_toolbar and key modules added and the issue does not occur. So perhaps one of the many modules that I am using cause this.

    To get going for now with dev work I used the patch on comment 5 but had to improve on it as there are more places where $config['source'] is checked. I am not saying this is the solution but may help others in their dev environment add a language.

    Regards Rory

  • Issue was unassigned.
  • Status changed to Active 14 days ago
  • 🇳🇿New Zealand quietone

    If this problem was discovered on a version of Drupal that is not 11.x, add that information in the issue summary and leave the version at 11.x. In Drupal core changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies . Also mentioned on the version section of the list of issue fields documentation.

    I restored the standard template to make it easier to track progress here.

  • 🇮🇳India Ishani Patel

    I've tested with D10.4.5 and D11.1.6 ,checked with adding new language also checked with already added language edit page but not reproduced this error.

    Thank you!

Production build 0.71.5 2024