Issue Bug Closed

#107234Wrong default‐language detection when languageId: 0 is not the first item in site config.yaml

Elias Weber 08/08/25, 10:47 updated 10/29/26, 21:52

Description

While investigating how to change the default landing language when no language path is provided in the URL, I discovered that reordering the language entries in the site’s config.yaml produced the desired behavior.
Now, after some testing, it turns out that the problem had nothing to do with the order of entries. Instead it was caused by a change in the default language.

*Problem:*
I encountered some strange backend behavior, when the language with languageId: 0 (default language) is not the first language item in the site config.yaml.
Resulting problem for example:
languages_bug.png

*How to reproduce:*
- changing order to something like this:

languages:
  -
    title: English
    languageId: 1
    ...
  -
    title: German
    languageId: 0
    ...

- clear caches
- open any backend page with language columns

*Why?*
The method Site/Entity/Site::getDefaultLanguage() always returns the first array element, regardless of its languageId.
Therefore, in for Example BackendLayoutRenderer::getLanguageColumnsForPageLayoutContext(), English is treated as the default language instead of German.

*Expected:*
I expect a consistent behavior, e.g. that the default language is always the one with languageId: 0, no matter its position in the yaml language array.

Problem encountered in 12.4 & 13.4

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Files 1

History 6

  1. S P commented <span data-processor="relativetime" data-value="2025-10-24T09:33:36+00:00" > 10/24/25, 09:33 </span>

    Georg Ringer wrote in #note-2:
    > Guess this is a duplicate of #99064?

    Yes, it is.

  2. Oliver Bartsch commented and changed status New Closed <span data-processor="relativetime" data-value="2026-10-29T21:52:30+00:00" > 10/29/26, 21:52 </span>

    This is already tracked in #99064, so I’m closing this one as a duplicate and will continue there.