Bug #93719
closedSite config: language baseVariants still get removed when saving from GUI
100%
Description
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/'
baseVariants:
-
base: 'https://dev.domain.de/'
condition: 'applicationContext == "Development"'
languages:
-
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/'
baseVariants:
-
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.
Updated by Benjamin Robinson about 3 years ago
- Related to Bug #90159: Site config: language baseVariants get removed when saving from GUI added
Updated by Benjamin Robinson about 3 years ago
- Category set to Link Handling, Site Handling & Routing
Updated by Oliver Bartsch about 3 years ago
Hi,
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
Updated by Gerrit Code Review over 1 year ago
- Status changed from Accepted to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76460
Updated by Gerrit Code Review over 1 year ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76460
Updated by Gerrit Code Review over 1 year ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76460
Updated by Gerrit Code Review over 1 year ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76460
Updated by Gerrit Code Review over 1 year ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76496
Updated by Benni Mack over 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 29f3d83f2e06f8f914cc74846cf0f6ec9aa68e45.
Updated by Gerrit Code Review over 1 year ago
- Status changed from Resolved to Under Review
Patch set 2 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76496
Updated by Gerrit Code Review over 1 year ago
Patch set 3 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76496
Updated by Benni Mack over 1 year ago
- Status changed from Under Review to Resolved
Applied in changeset 52c3940064e945e02afa40df8a9830010a883ebd.