Issue Bug Closed

#99028FormDataCompiler->compile returns a string instead of an array for a select field since TYPO3 v11.5.18

Chris Müller 11/09/22, 09:39 updated 11/26/22, 21:00

Description

I am using in an old PageLayoutViewDrawItem hook for generating a content element preview with the following code:

$formDataGroup = GeneralUtility::makeInstance(TcaDatabaseRecord::class);
$formDataCompiler = GeneralUtility::makeInstance(FormDataCompiler::class, $formDataGroup);
$formDataCompilerInput = [
    'command' => 'edit',
    'tableName' => 'tt_content',
    'vanillaUid' => (int)$row['uid'],
];
$result = $formDataCompiler->compile($formDataCompilerInput);

Until TYPO3 v11.5.17 the content of $result[‘databaseRow’][‘myfield’] is returned as an array [‘156’].

The field is defined in TCA as a select field with renderType “selectMultipleSideBySide”:

'myfield' => [
    'label' => 'My field',
    'config' => [
        'type' => 'select',
        'renderType' => 'selectMultipleSideBySide',
        'foreign_table' => 'tx_ext_domain_model_foreigntable',
        'foreign_table_where' => ' AND tx_ext_domain_model_foreigntable.sys_language_uid=0 ORDER BY header',
        'minitems' => 1,
        'behaviour' => [
            'allowLanguageSynchronization' => true,
        ],
        'default' => 0,
    ],
]

Since TYPO3 v11.5.18 a string is returned: ‘156’.

Reviews 0

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