Issue Bug Closed

#95856Array to string conversion warning in IconFactory

Robert Kärner 11/03/21, 09:38 updated 10/04/22, 14:13

Description

In the pages table, field module is configured in the TCA as 'type' => 'select' and renderType => 'selectSingle'.
The value is stored in the database as a simple string, i.e. $row['module'] = 'fe_users'.

When editing such a page record in the backend, TYPO3\Backend\Form\FormDataProvider\TcaSelectItems->addData() converts this string to an array like this: $row['module'] = [0 => 'fe_users'].

On PHP 8, this causes TYPO3\Core\Imaging\IconFactory->mapRecordTypeToIconIdentifier() to throw a
@PHP Warning: Array to string conversion in typo3\sysext\core\Classes\Imaging\IconFactory.php line 190@,
as it expects $row[‘module’] to be a plain string.

Reviews 1