Skip to content
Snippets Groups Projects
Commit 5d16076e authored by Benjamin Franzke's avatar Benjamin Franzke
Browse files

[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: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarBenjamin Franzke <ben@bnf.dev>
Tested-by: default avatarBenjamin Franzke <ben@bnf.dev>
parent c768d0fd
Branches
Tags
No related merge requests found
Showing
with 176 additions and 21 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment