#105619GeneralUtility::trimExplode(): Argument #2 ($string) must be of type string, null given, called in AbstractItemProvider.php on line 979
Description
TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(): Argument #2 ($string) must be of type string, null given, called in /var/www/html/vendor/typo3/cms-backend/Classes/Form/FormDataProvider/AbstractItemProvider.php on line 979
I have a TCA select field with the following configuration. Items are automatically filled by a helper method and include an empty string as default value.
‘course_country’ => [
‘exclude’ => 1,
‘label’ => ‘Course country’,
‘config’ => [
‘type’ => ‘select’,
‘renderType’ => ‘selectSingle’,
‘nullable’ => true, // This does nothing for type select
‘items’ => LocalisationHelper::readCountriesForTCA(),
]
],
SQL definition:
@course_country varchar(3) NULL,@
These records are created in the frontend and have this Model attribute:
public ?string $courseCountry = null;
So it’s possible this database field is null. In TYPO3 v11 the backend form could be opened without a problem. Since v13 upgrade the error occurs. This is probably due to a missing check for null or missing type cast to string in AbstractItemProvider.
Additional note: There seems to be no possibility to have null values for select fields via the backend. Maybe it could be benefitial to introduce the nullable option for selects as well.
Reviews 2
Related issues 1
History 46
-
Nikita Hovratov changed description <span data-processor="relativetime" data-value="2024-11-18T10:17:19+00:00" > 11/18/24, 10:17 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 87011 status
NewUnder Review <span data-processor="relativetime" data-value="2024-11-18T10:45:14+00:00" > 11/18/24, 10:45 </span> -
Nikita Hovratov changed Related to #101453 <span data-processor="relativetime" data-value="2024-11-18T10:45:43+00:00" > 11/18/24, 10:45 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 87180 <span data-processor="relativetime" data-value="2024-11-22T07:23:20+00:00" > 11/22/24, 07:23 </span>
-
Nikita Hovratov commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2024-11-22T07:25:09+00:00" > 11/22/24, 07:25 </span> -
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2025-12-02T14:31:31+00:00" > 12/02/25, 14:31 </span>
Applied in changeset commit:91d1c6aedb487400edc53bdbda7c3ba09b3029c8.