Skip to content

Commit

Permalink
[BUGFIX] Harmonize site configurations "flag" setting
Browse files Browse the repository at this point in the history
In the site configuration, the value is called "flag",
whereas in TypoScript or in the SiteLanguage object,
it is called "flagIdentifier" which is longer, but
technically more correct.

This change now also allows to use
page.10 = TEXT
page.10.data = siteLanguage:flag

instead of

page.10 = TEXT
page.10.data = siteLanguage:flagIdentifier

to avoid confusion for integrators.

Resolves: #94347
Releases: main, 11.5
Change-Id: Ie15614bd7ec7d7461fbecc4cc791314bda2c236f
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/79512
Tested-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
  • Loading branch information
bmack authored and sbuerk committed Jun 27, 2023
1 parent cd000ec commit d471a55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Expand Up @@ -4501,6 +4501,10 @@ public function getData($string, $fieldArray = null)
case 'sitelanguage':
$siteLanguage = $this->getTypoScriptFrontendController()->getLanguage();
$config = $siteLanguage->toArray();
// Harmonizing the namings from the site configuration value with the TypoScript setting
if ($key === 'flag') {
$key = 'flagIdentifier';
}
if (isset($config[$key])) {
$retVal = $config[$key] ?? '';
}
Expand Down
Expand Up @@ -481,6 +481,8 @@ public function getFieldAsJson(string $content, array $conf): string
$language = $site->getLanguageById((int)$conf['language']);
if ($language->enabled()) {
$language = $language->toArray();
// Harmonizing the namings from the site configuration value with the TypoScript setting
$language['flag'] = $language['flagIdentifier'];
} else {
return $this->jsonEncode(null);
}
Expand Down

0 comments on commit d471a55

Please sign in to comment.