Project

General

Profile

Actions

Bug #99028

closed

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

Added by Chris Müller about 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2022-11-09
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

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'.

Actions

Also available in: Atom PDF