Issue Bug Closed

#108989Schema Api ->getField some times results in Type Error

Matthias Vogel 02/16/26, 14:39 updated 03/31/26, 08:11

Description

Uncaught TYPO3 Exception TYPO3\CMS\Core\Schema\Struct\SelectItem::__construct(): Argument #2 ($label) must be of type string, int given, called in typo3/sysext/core/Classes/Schema/Struct/SelectItem.php on line 48
thrown in file typo3/sysext/core/Classes/Schema/Struct/SelectItem.php
in line 31
        \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Schema\TcaSchemaFactory::class)
            ->get('sys_file_metadata.1')
            ->getField('ranking')
            ->getItems();

This is because in sys_file_metadata.ranking the items have labels that are integers:
https://github.com/TYPO3/typo3/blob/53c3514c99728b8582b915dac22f3007627db541/typo3/sysext/filemetadata/Configuration/TCA/Overrides/sys_file_metadata.php#L349-L354

We could only switch the int to string.
But that would not fix the situation in the extensions that still use int.
So we cast to string.

Broken in v13 and v14

Reviews 2

History 24

  1. Matthias Vogel commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-02-16T19:05:10+00:00" > 02/16/26, 19:05 </span>

    Applied in changeset commit:467d10191441a07361fb91813f216fed8384f2e0.