[BUGFIX] Fix access to array values in SiteSettings->get()
If settings definitions are configured to use the type `stringlist`, it is expected that `SiteSettings->get('setting.key')` returns the array of strings, but failed for namespaced keys (separated by at least one dot) because of array-flattening. Array-flattening does only provide access to concrete array values, as `ArrayUtility::flattenPlain` transform a settings tree like ``` [ 'foo' => [ 'bar' => ['a', 'b'], ], ], ``` …into a flat list like: ``` [ 'foo.bar.0' => 'a', 'foo.bar.1' => 'b', ] ``` That means the key `foo.bar` is considered as not existent. To provide access to actively defined settings key, a new settings map is composed from the list of active setting definition keys. For compatibility reasons the old array flattening is still used for: a) undefined settings b) access to sub-values (as it worked before) Releases: main Resolves: #104858 Change-Id: Id3304d4673f778ef8a78381dd317816c0e8f1a13 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/85924 Reviewed-by:Stefan Bürk <stefan@buerk.tech> Tested-by:
core-ci <typo3@b13.com> Tested-by:
Stefan Bürk <stefan@buerk.tech> Tested-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Benjamin Franzke <ben@bnf.dev> Tested-by:
Benjamin Franzke <ben@bnf.dev>
Showing
- typo3/sysext/core/Classes/Configuration/SiteConfiguration.php 2 additions, 1 deletion...3/sysext/core/Classes/Configuration/SiteConfiguration.php
- typo3/sysext/core/Classes/Site/Entity/Site.php 2 additions, 1 deletiontypo3/sysext/core/Classes/Site/Entity/Site.php
- typo3/sysext/core/Classes/Site/Entity/SiteSettings.php 35 additions, 7 deletionstypo3/sysext/core/Classes/Site/Entity/SiteSettings.php
- typo3/sysext/core/Classes/Site/SiteSettingsFactory.php 36 additions, 11 deletionstypo3/sysext/core/Classes/Site/SiteSettingsFactory.php
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_site_settings/Configuration/Sets/Set1/config.yaml 2 additions, 0 deletions...ns/test_site_settings/Configuration/Sets/Set1/config.yaml
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_site_settings/Configuration/Sets/Set1/settings.definitions.yaml 5 additions, 0 deletions...ettings/Configuration/Sets/Set1/settings.definitions.yaml
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_site_settings/composer.json 14 additions, 0 deletions...onal/Fixtures/Extensions/test_site_settings/composer.json
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_site_settings/ext_emconf.php 21 additions, 0 deletions...nal/Fixtures/Extensions/test_site_settings/ext_emconf.php
- typo3/sysext/core/Tests/Functional/Site/Entity/SiteSettingsTest.php 56 additions, 0 deletions...xt/core/Tests/Functional/Site/Entity/SiteSettingsTest.php
- typo3/sysext/core/Tests/Functional/TypoScript/PageTsConfigFactoryTest.php 3 additions, 1 deletion...e/Tests/Functional/TypoScript/PageTsConfigFactoryTest.php
Please register or sign in to comment