90849[BUGFIX] Allow Fluid access to SiteLanguage configuration
Commit message
Review
-
Code review CR +2 Done
- Stefan Bürk +2
- Georg Ringer +1
- Garvin Hicking +1
-
Verified V +2 Done
- Stefan Bürk +2
- Georg Ringer +1
- Garvin Hicking +1
- core-ci +1 CI
Issues 1
Files 7
- typo3/sysext/core/Classes/Site/Entity/SiteLanguage.php9+5 −0
- typo3/sysext/frontend/Tests/Functional/DataProcessing/Fixtures/Site/Pages/Default.htmlnew+3 −0
- typo3/sysext/frontend/Tests/Functional/DataProcessing/Fixtures/Site/Pages/Home.htmlnew+7 −0
- typo3/sysext/frontend/Tests/Functional/DataProcessing/Fixtures/Site/Pages/Productdetail.htmlnew+3 −0
- typo3/sysext/frontend/Tests/Functional/DataProcessing/Fixtures/Site/Partials/SingleContent.htmlnew+13 −0
- typo3/sysext/frontend/Tests/Functional/DataProcessing/Fixtures/Site/setup.typoscriptnew+11 −0
- typo3/sysext/frontend/Tests/Functional/DataProcessing/SiteProcessorTest.phpnew+84 −0
Review log 2125
-
Garvin Hicking uploaded patch set 1 09/30/25, 20:32
-
core-ci voted on patch set 1 V +1 09/30/25, 20:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85759
-
Simon Schaufelberger voted on patch set 1 CR +1 V +1 10/01/25, 10:00
-
Stefan Bürk commented on patch set 1 10/01/25, 10:01
TBH not tested, but from reading the code in SiteLanguage, the syntax here retrieves the array and than operates on the array, making the additional lookup in the get/has code obsolete ... and providing "duplicated" access now: ``` SiteLanguage complete configuration: {siteLanguage.configuration} NavigationTitle on configuration array: {siteLanguage.configuration.navigationTitle} NavigationTitle direct: {siteLanguage.navigationTitle} ``` Or should we only allow the "transient" mapped access and not having `configuration` as special handled key to retrieve the configuration, or only that access not doing the "direct" mapping again ?SiteLanguage.php:194See comment o commit message ... does it really make sense to allow direct mapping and duplicated access on the `configuration` array ?SiteLanguage.php:203```suggestion return array_key_exists($id, $activeConfiguration); ``` This allows access to merged raw configuration along with merged properts provided by `toArray()` and using `isset()` here would return false in case the identifier is set in the array but the value is false, which is semantically something else than not having that key/identifier set. We do not now which custom configuration is provided and handling an existing key with null value as `not has / false` is something I would not expect. Maybe switching to `array_key_exists()` here ? See also following example (https://3v4l.org/67AdD): ``` $array = [ 'id' => null, ]; var_dump(isset($array['id'])); // false var_dump(array_key_exists('id', $array)); // true ``` -
Stefan Bürk voted on patch set 1 CR -1 10/01/25, 10:01
-
Garvin Hicking commented on patch set 1 10/01/25, 10:11
I think I'll have to retract from this, I'm not deep enough into it and just wanted to have a first "offer" to fix the reported bug. Happy for anyone to pick up. -
Soren Malling commented on patch set 1 10/07/25, 12:39
@garvin@hick.ing It should be enough to introduce a `public function getConfiguration(): array` similar to the `Site` object itself. It will allow for accessing it in the view like `siteLanguage.configuration.whateverCustomKey`. That's the original issue that me and Robert was facing when helping him in Slack originally -
Garvin Hicking commented on patch set 1 10/07/25, 12:54
Reply
yeah I tried the interface to align with Sitelanguage and others. If you want you can rework / edit this patch, I won't find time for this soon.SiteLanguage.php:203ReplyFix applied. -
Garvin Hicking marked it work in progress 10/07/25, 12:54
-
Soren Malling uploaded patch set 2
CR +1V +110/07/25, 13:15 -
Garvin Hicking commented on patch set 2 10/07/25, 13:20
This change is ready for review.SiteLanguage.php:183does this contain everything that "toArray" offers? -
core-ci voted on patch set 2 V -1 10/07/25, 13:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86159
-
Soren Malling uploaded patch set 3
V -110/07/25, 13:27 -
core-ci voted on patch set 3 V +1 10/07/25, 13:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86165
-
Soren Malling commented on patch set 3 10/08/25, 11:04
SiteLanguage.php:183ReplyNo, it leaves the properties $this->languageId = $languageId; $this->locale = new Locale($locale); $this->base = $base; in the root of the {siteLanguage} object and gives you the {siteLanguage.configuration} array. This to stay as close to the Site object as possible. But I'm open for returning `toArray()` 👌 -
Garvin Hicking commented on patch set 3 10/08/25, 12:22
SiteLanguage.php:183ReplyMy expectation would probably be to have the same return as in an `array()` cast in PHP, I think that could be more helpful to manage the existing keys? (That was my initial intention of the first patchset, to make this 'toArray()' structure available) -
Soren Malling commented on patch set 3 10/08/25, 12:56
SiteLanguage.php:183ReplyAll cool by me - want me to adjust it to `return $this->toArray();` ? -
Garvin Hicking commented on patch set 4
V +110/08/25, 13:23Published edit on patch set 3. -
Garvin Hicking commented on patch set 4 CR +1 V +1 10/08/25, 13:25
Voting on Sorens rework/approach - though my vote only counts as a "normal person" vote and not a merger vote of course, so we still need one merger and anyone else.Reply
We went the easier route now to propagate the info (see later comments), I'm resolving this now.SiteLanguage.php:183ReplyJust adjusted this. For me this looks good enough to vote on. Thank you!SiteLanguage.php:194ReplyDone -
core-ci voted on patch set 4 V +1 10/08/25, 13:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86232
-
Georg Ringer voted on patch set 4 CR +1 V +1 10/08/25, 14:39
-
Stefan Bürk commented on patch set 4 CR -1 10/08/25, 18:04
Reviewing ... -
Stefan Bürk commented on patch set 4 CR +2 V +2 10/09/25, 07:49
Reply
Done -
Stefan Bürk merged patch set 5 10/09/25, 08:05