#109488Site Settings: Detail view crashes when rendering 'stringlist' types (Array to string conversion)
Description
With the introduction of the new Site Settings Detail View in TYPO3 v14, a regression/oversight occurs when a setting is defined as a stringlist. The template attempts to render the value directly, but since stringlist values are stored as arrays, Fluid throws a TYPO3Fluid\Fluid\Core\Parser\Exception: “Cannot cast an array to string.”
Environment- TYPO3 Version: 14.x (Development/Current)
- Component: cms-backend (Site Configuration / Settings Module)
- Define a setting with type stringlist in your settings.definitions.yaml:
email.templateRootPaths:
default: ['']
type: stringlist
category: email
- Navigate to the Sites > Setup > Gear Icon.
- Add two or more templates to Email Template Root Paths
- Open the “View Detail” for the site setup.
- The page will trigger a critical error (Exception #1698750868).
*Affected Code*
File: EXT:backend/Resources/Private/Templates/SiteConfiguration/Detail.fluid.html
Line: 514
The current implementation lacks a check for the data type before outputting {setting.value}.
*Proposed Solution*
Since the Detail View is intended to show a summary of all active settings, it should handle different configuration types gracefully. Implementing an f:switch based on {setting.definition.type} is the cleanest way to ensure that arrays or booleans are rendered correctly.
Example Fix:
<span class="treelist-value">
<f:switch expression="{setting.definition.type}">
<f:case value="stringlist">
<f:for each="{setting.value}" as="value" iteration="settingIterator">
{value}{f:if(condition: settingIterator.isLast, else: ', ')}
</f:for>
</f:case>
<f:defaultCase>
{setting.value}
</f:defaultCase>
</f:switch>
</span>