Issue Bug Closed

#102278Missing default value for property Container.php:$prototypeObjectsWhichAreCurrentlyInstanciated will lead to #1546632293 RuntimeException in GenericObjectValidator.php

Tobi Ferger 10/27/23, 19:43 updated 07/09/24, 15:19

Description

In the class TYPO3\CMS\Extbase\Object\Container\Container.php the declaration of property $prototypeObjectsWhichAreCurrentlyInstanciated lacks of default value “empty array”.
This leads to #1546632293 RuntimeException in Extbase/Validation/Validator/GenericObjectValidator.php:72 when e.g. reflection service try to access an uninitialized property like you have in models with an objectstorage property instanciated via constructor when they are defined as nullable.

change TYPO3\CMS\Extbase\Object\Container\Container.php:75:
private $prototypeObjectsWhichAreCurrentlyInstanciated;
to
private $prototypeObjectsWhichAreCurrentlyInstanciated = [];
to fix.

Reviews 1