Issue Bug Closed

#105062Extbase DataMapper type error, for empty passthrough relation (since 13.3.0)

Armin Vieweg 09/20/24, 09:21 updated 12/02/25, 14:33

Description

I get this error (in DCE extension) when updating from 13.2.1 to 13.3.0:

> TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper::thawObjectProperty(): Return value must be of type ?object, array returned in /var/www/html/vendor/typo3/cms-extbase/Classes/Persistence/Generic/Mapper/DataMapper.php line 308

The problem is a column which is from type “passthrough” and got the value 0.

In \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper::getEmptyRelationValue the $relatesToOne variable is false (in v13.3.0) which returns an empty array, instead of null. In v13.2.1 this variable is true.

The getEmptyRelationValue-Method is being called by mapObjectToClassProperty which is being called by thawObjectProperty. But thawObjectProperty has typehinting ?object which causes the type error, because of the returned empty array.

Reviews 2