Project

General

Profile

Actions

Bug #105619

open

GeneralUtility::trimExplode(): Argument #2 ($string) must be of type string, null given, called in AbstractItemProvider.php on line 979

Added by Nikita Hovratov 3 days ago. Updated 3 days ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2024-11-18
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
13
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #101453: Add native type declarations to GU array methodsClosedOliver Klee2023-07-26

Actions
Actions

Also available in: Atom PDF