Review main Merged

85924[BUGFIX] Fix access to array values in SiteSettings->get()

Benjamin Franzke CR +2 V +2 Normal +176 −21 updated 09/09/24, 11:41

Commit message

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)

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Stefan Bürk +1
    • Benni Mack +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Stefan Bürk +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 10

Review log 1017

  1. Benjamin Franzke uploaded patch set 1 09/09/24, 02:38

  2. core-ci voted on patch set 1 V -1 09/09/24, 02:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65047

  3. core-ci voted on patch set 1 V +1 09/09/24, 02:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65047

  4. Benjamin Franzke uploaded patch set 2 V +1 09/09/24, 09:07

  5. core-ci voted on patch set 2 V -1 09/09/24, 09:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65067

  6. Benjamin Franzke uploaded patch set 3 V -1 09/09/24, 09:25

  7. core-ci voted on patch set 3 V +1 09/09/24, 09:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65071

  8. Benjamin Franzke uploaded patch set 4 V +1 09/09/24, 09:51

  9. core-ci voted on patch set 4 V +1 09/09/24, 09:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65075

  10. Benjamin Franzke updated the commit message in patch set 5 V +1 09/09/24, 10:01

  11. core-ci voted on patch set 5 V +1 09/09/24, 10:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65078

  12. Benjamin Franzke uploaded patch set 6 V +1 09/09/24, 10:22

  13. core-ci voted on patch set 6 V +1 09/09/24, 10:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65080

  14. Stefan Bürk voted on patch set 6 CR +1 V +1 09/09/24, 10:59

  15. Benni Mack voted on patch set 6 CR +1 V +1 09/09/24, 11:38

  16. Benjamin Franzke voted on patch set 6 CR +2 V +2 09/09/24, 11:40

  17. Benjamin Franzke merged patch set 7 09/09/24, 11:41