Bug #102278
closedMissing default value for property Container.php:$prototypeObjectsWhichAreCurrentlyInstanciated will lead to #1546632293 RuntimeException in GenericObjectValidator.php
100%
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.
Updated by Tobi Ferger over 1 year ago
- Related to Bug #95819: Extbase does not support uninitialized domain object properties added
Updated by Tobi Ferger over 1 year ago
- Related to Bug #97646: Extbase property mapper does not work with uninitialized properties added
Updated by Tobi Ferger over 1 year ago
Updated by Christian Weiske 12 months ago
- Related to Task #95326: Do not use custom "getInstance()" methods on Singleton interfaces added
Updated by Christian Weiske 12 months ago
We see this bug on TYPO3 11.5.33.
In TYPO3 v10, getInstance()
was called which initialized the default empty array value. With symfony dependency injection since #84112 this method does not get called anymore.
Stack trace:
(1/1) TypeError array_key_exists(): Argument #2 ($array) must be of type array, null given in /var/www/html/web/typo3/sysext/extbase/Classes/Object/Container/Container.php line 171 at array_key_exists() in /var/www/html/web/typo3/sysext/extbase/Classes/Object/Container/Container.php line 171 at TYPO3\CMS\Extbase\Object\Container\Container->getInstanceInternal() in /var/www/html/web/typo3/sysext/extbase/Classes/Object/Container/Container.php line 226 at TYPO3\CMS\Extbase\Object\Container\Container->injectDependencies() in /var/www/html/web/typo3/sysext/extbase/Classes/Object/Container/Container.php line 130 at TYPO3\CMS\Extbase\Object\Container\Container->getEmptyObject() in /var/www/html/web/typo3/sysext/extbase/Classes/Object/ObjectManager.php line 138 at TYPO3\CMS\Extbase\Object\ObjectManager->getEmptyObject() in /var/www/html/web/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php line 171 at TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper->createEmptyObject() in /var/www/html/web/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php line 144
Updated by Gerrit Code Review 12 months ago
- Status changed from New to Under Review
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83707
Updated by Gerrit Code Review 12 months ago
Patch set 2 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83707
Updated by Gerrit Code Review 12 months ago
Patch set 3 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83707
Updated by Simon Schaufelberger 12 months ago
In TYPO3 11 the method must be named initializeObject
Updated by Anonymous 12 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 878373502eac92c6d6e69bd70bb4781665ab5750.