Bug #93719

Site config: language baseVariants still get removed when saving from GUI

Added by Ben Robinson 8 months ago. Updated 7 months ago.

Should have
Link Handling, Site Handling & Routing
Target version:
Start date:
Due date:
% Done:


Estimated time:
TYPO3 Version:
PHP Version:
Is Regression:
Sprint Focus:


If a site contains language baseVariants they will be removed from the .yaml after saving the site config in the backend under certain conditions.

Steps to reproduce:

1. Create config.yaml

base: 'https://www.domain.de/'
    base: 'https://dev.domain.de/'
    condition: 'applicationContext == "Development"'
    title: 'Deutsch'
    enabled: true
    base: /
    typo3Language: de
    locale: de_DE.utf8
    iso-639-1: de
    navigationTitle: Deutsch
    hreflang: de-DE
    direction: ''
    flag: de
    languageId: 0
    title: 'English'
    enabled: true
    base: 'https://www.en.domain.de/'
        base: 'https://dev.en.domain.de/'
        condition: 'applicationContext == "Development"'
    typo3Language: default
    locale: en_GB.utf8
    iso-639-1: en
    navigationTitle: English
    hreflang: en-DE
    direction: ''
    fallbackType: strict
    fallbacks: ''
    flag: gb
    languageId: 1
    websiteTitle: ''
rootPageId: 2
websiteTitle: ''

2. Clear all caches

3. Edit some setting of the language via Backend GUI, for example change the title 'English' -> 'British English', or the locale "en_GB.utf8" -> en_US.utf8.

The language's baseVariants will get removed.

Related issues

Related to TYPO3 Core - Bug #90159: Site config: language baseVariants get removed when saving from GUIClosed2020-01-20


Updated by Ben Robinson 8 months ago

  • Related to Bug #90159: Site config: language baseVariants get removed when saving from GUI added

Updated by Ben Robinson 8 months ago

  • Category set to Link Handling, Site Handling & Routing

Updated by Oliver Bartsch 7 months ago


I had a short look into this and can confirm that the base variants on a language level are removed when editing this language in the GUI.

This seems to be not related to the actual write process but caused by the SiteConfigurationController. Since #87831 it's possible to define baseVariants for languages. But because this is not reflected in the corresponding TCA [1], they are not included in $newSysSiteData - in case the language was adjusted - and therefore are being removed [2] before they are even passed to the write() method.

The reason why it won't be overwritten in case the corresponding language was not adjusted is that in such case, the array is just filled with the data from the current configuration [3]. If the site_language however exists in the passed form data - because it was changed, the values are overwritten [4]. And as mentioned, the baseVariants field does not exists in the TCA, so it won't be included in the passed form data and even if, can not be processed [5] as it would be of type inline.

[1] https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/backend/Configuration/SiteConfiguration/site_language.php
[2] https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/backend/Classes/Controller/SiteConfigurationController.php#L339
[3] https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/backend/Classes/Controller/SiteConfigurationController.php#L293
[4] https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/backend/Classes/Controller/SiteConfigurationController.php#L299
[5] https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/backend/Classes/Controller/SiteConfigurationController.php#L305

Also available in: Atom PDF