Issue Bug Closed

#107561Regression: Field type select (renderType selectMultipleSideBySide) broken in context of Site Configuration

Claus Due 09/29/25, 11:16 updated 09/30/26, 19:32

Description

Using this field type and saving the content causes an exception. Apparently, the site configuration writer demands that the input must be an array, but the FormEngine HTML for this field type results in posting a string CSV value.

This exact same setup works perfectly on v12 and has worked on v13 before now. Uncertain when this regression happened.

Example TCA:

$GLOBALS[‘SiteConfiguration’][‘site’][‘columns’][‘demo’] = [
‘label’ => ‘Broken field’,
‘config’ => [
‘type’ => ‘select’,
‘renderType’ => ‘selectMultipleSideBySide’,
‘items’ => [
[‘value’ => ‘1’, ‘label’ => ‘1’],
[‘value’ => ‘2’, ‘label’ => ‘2’],
],
],
];

Saving this field posts the value as string:

1,2

Which triggers the following error:

TYPO3\CMS\Core\Configuration\Loader\YamlPlaceholderGuard::protectPlaceholders(): Argument #1 ($current) must be of type array, string given, called in /var/www/html/vendor/typo3/cms-core/Classes/Configuration/Loader/YamlPlaceholderGuard.php on line 66

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 10

  1. Claus Due commented <span data-processor="relativetime" data-value="2025-09-29T11:24:52+00:00" > 09/29/25, 11:24 </span>

    You may need to preset a value in the site configuration YAML file, e.g.

    base: '...'
    demo: '1,2'

    Saving the field type without an existing value saves the selections as array in YAML. However, this breaks any site configuration that has an existing value, and subsequently breaks any implementations that previously depended on a CSV value in the site configuration.

    TYPO3 must again save this value as CSV since this different behavior constitutes a breaking change implemented in a bugfix release. At the very least, TYPO3 must add a feature flag to switch to the new behavior, which implementers can then read to determine the expected format of this setting. If the default behavior is changed for v14 this must also be documnented as a breaking change requiring configuration migration.

    Additionally:

    • Loading the site configuration with that feature flag enabled must silently convert the value to array.
    • Saving the site configuration with that feature flag enabled must silently convert the value being stored to an array, regardless of the format of existing values in the YAML file.
  2. Garvin Hicking commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2025-09-30T12:21:05+00:00" > 09/30/25, 12:21 </span>

    I have tested this with many TYPO3 v13 releases (13.4.17, 13.4.10, 13.4.5, 13.4.1), and it does not work with TYPO3 13.4.1 already.

    How did demo: '1,2' come into your YAML?

    It should always be saved as:

    demo:
      - '1'
      - '2'

    and when it’s saved like that, reading and saving the values work.

    So I’m assuming this is rather some other quirk on how the values were added there. The type must be an array, not a string, I would say.

    I think it would be good to adjust the site config YAML in such a case, and work with the array structure from there forward.

  3. Garvin Hicking commented and changed status Needs Feedback Closed <span data-processor="relativetime" data-value="2025-10-17T17:18:40+00:00" > 10/17/25, 17:18 </span>

    Closing due to missing feedback. Feel free to provide more details to reinvestigate.

  4. Philipp Wrann commented and changed target version <span data-processor="relativetime" data-value="2026-03-26T14:55:24+00:00" > 03/26/26, 14:55 </span>

    Ouch, this is a very severe bug – you changed the storage format of the selectMultipleSideBySide without providing a migration for the existing yaml, so all of our websites will be broken after the v13 update. Now i need to add migrations to all packages by myself.

    How to reproduce?

    1) Use a V12-Project
    2) Add a custom site configuration field of type selectMultipleSideBySide
    3) save some values
    4) upgrade to V13
    5) goto site config and save

  5. Philipp Wrann commented <span data-processor="relativetime" data-value="2026-03-26T15:00:09+00:00" > 03/26/26, 15:00 </span>

    Sorry for adding you as watcher @benni but this is so severe, the ticket needs to be re-opened and i don’t have permission.

  6. Philipp Wrann commented <span data-processor="relativetime" data-value="2026-03-26T16:08:07+00:00" > 03/26/26, 16:08 </span>

    This is my very naive solution (i did not even test the nested fixing because my product stack does not have any selectMultipleSideBySide field in a language or route or whatever). I don’t know if it affects ONLY the renderType selectMultipleSideBySide, i don’t know, if this breaks something, i just wanted to share it:

    And sorry for my bad language, i suggest you you don’t copy that :D

    <?php
    declare(strict_types=1);
    
    namespace Vendor\Package\Migrations;
    
    use Symfony\Component\Console\Output\OutputInterface;
    use TYPO3\CMS\Core\Configuration\SiteWriter;
    use TYPO3\CMS\Core\Core\Environment;
    use TYPO3\CMS\Core\Site\SiteFinder;
    use TYPO3\CMS\Core\Utility\GeneralUtility;
    use TYPO3\CMS\Install\Attribute\UpgradeWizard;
    use TYPO3\CMS\Install\Updates\ChattyInterface;
    use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
    use TYPO3\CMS\Lowlevel\ConfigurationModuleProvider\SitesTcaConfigurationProvider;
    
    #[UpgradeWizard('vendor_fixSiteConfigurationFuckUp')]
    final class FixSiteConfigurationFuckUp implements UpgradeWizardInterface, ChattyInterface
    {
        private OutputInterface $output;
    
        public function __construct(
            private readonly SitesTcaConfigurationProvider $siteTcaConfigurationProvider,
            private readonly SiteFinder $siteFinder,
            private readonly SiteWriter $siteWriter,
        ) { }
    
        public function setOutput(OutputInterface $output): void
        {
            $this->output = $output;
        }
    
        public function getTitle(): string
        {
            return "Fix site configuration";
        }
    
        public function getDescription(): string
        {
            return "emergency migration: Change storage format of custom selectMultipleSideBySide fields";
        }
    
        public function executeUpdate(): bool
        {
            $siteConfiguration = $this->siteTcaConfigurationProvider->getConfiguration();
            foreach ($this->siteFinder->getAllSites(false) as $site) {
                $current = $site->getRawConfiguration();
                $changes = $this->migrateSiteConfiguration($current, $siteConfiguration);
                if ($changes !== []) {
                    $this->output->writeln(sprintf('migrating values for site %s', $site->getIdentifier()));
                    $this->output->writeln(json_encode($changes));
                    copy(Environment::getConfigPath() . '/sites/' . $site->getIdentifier() . '/' . 'config.yaml', Environment::getConfigPath() . '/sites/' . $site->getIdentifier() . '/' . 'config.beforefuckupfixing.yaml');
                    $this->siteWriter->write($site->getIdentifier(), array_replace_recursive($current, $changes));
                }
            }
            return true;
        }
    
        private function migrateSiteConfiguration(array $map, array $siteConfiguration, string $type = 'site'): array
        {
            $changes = [];
            foreach ($map as $column => $value) {
                $siteFieldConfig = $siteConfiguration[$type]['columns'][$column] ?? null;
                if (!isset($siteFieldConfig['config'])) {
                    continue;
                }
                if (
                    ($siteFieldConfig['config']['type'] ?? null) === 'inline'
                    && is_string($siteFieldConfig['config']['foreign_table'] ?? null)
                    && isset($siteConfiguration[$siteFieldConfig['config']['foreign_table']])) {
                    $changes[$column] = [];
                    foreach ($value as $child) {
                        $changes[$column][] = $this->migrateSiteConfiguration($child, $siteConfiguration, $siteFieldConfig['config']['foreign_table']);
                    }
                    $changes[$column] = array_filter($changes[$column], fn(mixed $value) => $value !== []);
                } else {
                    if (($siteFieldConfig['config']['renderType'] ?? null) !== 'selectMultipleSideBySide') {
                        continue;
                    }
                    if (is_array($value)) {
                        continue;
                    }
                    if (!is_scalar($value)) {
                        continue;
                    }
                    $changes[$column] = GeneralUtility::trimExplode(',', (string) $value, true);
                }
            }
            return array_filter($changes, fn(mixed $value) => $value !== []);
        }
    
        public function updateNecessary(): bool
        {
            $siteConfiguration = $this->siteTcaConfigurationProvider->getConfiguration();
            foreach ($siteConfiguration as $config) {
                foreach ($config['columns'] ?? [] as $column) {
                    if (($column['config']['renderType'] ?? null) === 'selectMultipleSideBySide') {
                        return true;
                    }
                }
            }
            return false;
        }
    
        public function getPrerequisites(): array
        {
            return [];
        }
    
    }
  7. Georg Ringer commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2026-08-16T12:27:22+00:00" > 08/16/26, 12:27 </span>

    @majpay after reading the comments and the mentioned issue: is it correct that this is “only” a problem after updating from 12 => 13 and not within 13 itself? if so I would suggest closing this issue nevertheless

  8. Georg Ringer commented and changed status Needs Feedback Closed <span data-processor="relativetime" data-value="2026-09-30T19:32:42+00:00" > 09/30/26, 19:32 </span>

    Closing this issue.

    The storage format of `selectMultipleSideBySide` fields in the site configuration changed with TYPO3 v13.1 (site sets): values are now stored as YAML list instead of a comma-separated string. Within v13 itself this works as expected, the problem only occurs with values that were stored by TYPO3 v12.

    If you are affected, convert the value once in your config.yaml, e.g.

    demo: '1,2'

    to

                                                                                                                                                                                    
          demo:                                                                                                                                                                     
            - '1'                                                                                                                                                                   
            - '2'                                                                                                                                                                   

    or use an upgrade wizard as shown in comment #note-7. Afterwards saving the site configuration works again.