Actions
Bug #101400
closedGenericObjectValidator throws exception with lazy loaded objects
Start date:
2023-07-20
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
When a property of an Extbase domain model is lazy loaded but the current value does not exist any more (e.g. related record has been deleted), an exception is thrown when the domain model is validated through the GenericObjectValidator
PHP Warning: Attempt to read property "myProperty" on null in /path/to/typo3/sysext/extbase/Classes/Persistence/Generic/LazyLoadingProxy.php line 25
There is a TODO in getPropertyValue()
method in GenericObjectValidator
which says add support for lazy loading proxies, if needed
. The TODO is IMO wrong here, since we already support lazy loaded proxies, but the ObjectAccess::isPropertyGettable
function on the lazy loaded proxy results in loading an object which does not exist any more. Therefore the validator fails with an exception.
Actions