93540[BUGFIX] Handle non-scalar site settings in detail view
Commit message
Review
-
Code review CR +2 Done
- Georg Ringer +2
- Garvin Hicking +1
- Benni Mack +1
-
Verified V +2 Done
- Georg Ringer +2
- Garvin Hicking +1
- core-ci +1 CI
Issues 3
Files 2
Review log 1217
-
Michael Blunck uploaded patch set 1 04/04/26, 08:49
-
core-ci voted on patch set 1 V -1 04/04/26, 08:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99601
-
Garvin Hicking commented on patch set 1 04/04/26, 09:10
How do you feel about this as an alternative: ``` diff --git a/typo3/sysext/backend/Classes/Dto/Settings/EditableSetting.php b/typo3/sysext/backend/Classes/Dto/Settings/EditableSetting.php index 1059956500b..481ca98523f 100644 --- a/typo3/sysext/backend/Classes/Dto/Settings/EditableSetting.php +++ b/typo3/sysext/backend/Classes/Dto/Settings/EditableSetting.php @@ -17,6 +17,7 @@ declare(strict_types=1); namespace TYPO3\CMS\Backend\Dto\Settings; +use Stringable; use TYPO3\CMS\Core\Settings\SettingDefinition; /** @@ -35,4 +36,17 @@ final readonly class EditableSetting implements \JsonSerializable { return get_object_vars($this); } + + public function getValueAsScalar(): string + { + if (is_array($this->value)) { + return implode(', ', $this->value); + } + if (is_scalar($this->value)) { + return (string)$this->value; + } + if ($this->value instanceof Stringable) { + return $this->value->__toString(); + } + } } diff --git a/typo3/sysext/backend/Resources/Private/Templates/SiteConfiguration/Detail.fluid.html b/typo3/sysext/backend/Resources/Private/Templates/SiteConfiguration/Detail.fluid.html index 41c309456bc..89fc1c274b8 100644 --- a/typo3/sysext/backend/Resources/Private/Templates/SiteConfiguration/Detail.fluid.html +++ b/typo3/sysext/backend/Resources/Private/Templates/SiteConfiguration/Detail.fluid.html @@ -518,7 +518,7 @@ </span> <span class="treelist-operator">=</span> <span class="treelist-value"> - {setting.value} + {setting.valueAsScalar} </span> </span> </li> ``` -
Garvin Hicking updated the commit message in patch set 2
V -104/04/26, 09:13 -
core-ci voted on patch set 2 V -1 04/04/26, 09:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99603
-
Stefan Bürk commented on patch set 2 04/13/26, 00:30
Reply
@garvin@hick.ing TBH I would abstain from extending and handling that in the class. Not tried or tested this change out yet, but having a string feeling that this **should** (**could**) be handled in fluid only by making use of the `f:join` ViewHelper with his options - which should be pretty much a use-case here for that ViewHelper. See: https://docs.typo3.org/other/typo3/view-helper-reference/main/en-us/Global/Join.html with a single if-else viewhelper combination (not a switch) for now. What do you think ? @garvin@hick.ing @mi.blunck@gmail.com -
core-ci commented on patch set 2 04/13/26, 00:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99603
-
Garvin Hicking commented on patch set 2 04/13/26, 06:47
Reply
I find the fluid solution not good - for me, logic like this does not belong in the presentation side but PHP. I also think the DTO is quite lightweight and the right fit for this sinole abstraction. We definitely need this in LTS so we need to find a solution quickly. -
Garvin Hicking uploaded patch set 3
V -104/13/26, 11:43 -
Garvin Hicking uploaded patch set 4 04/13/26, 11:45
-
core-ci voted on patch set 4 V +1 04/13/26, 11:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100077
-
Garvin Hicking commented on patch set 4 CR +1 V +1 04/13/26, 12:03
Reply
I updated this patch with the alternate approach that was accidentally created (https://review.typo3.org/c/Packages/TYPO3.CMS/+/93547). For me this variant would be quite lightweight and easy to understand/read. -
core-ci voted on patch set 3 V -1 04/13/26, 12:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100076
-
Benni Mack commented on patch set 4 CR +1 04/13/26, 13:38
I'm fine adding it like this, it's a DTO marked as "internal" -
Garvin Hicking commented on patch set 4 04/13/26, 15:00
Reply
Done -
Georg Ringer voted on patch set 4 CR +2 V +2 04/13/26, 15:02
-
Georg Ringer merged patch set 5 04/13/26, 15:02