Project

General

Profile

Actions

Bug #101400

closed

GenericObjectValidator throws exception with lazy loaded objects

Added by Torben Hansen 10 months ago. Updated 10 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
Extbase
Target version:
-
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.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #103531: Ensure correct access for LazyLoadingProxy testResolvedStefan Bürk2024-04-04

Actions
Actions #1

Updated by Torben Hansen 10 months ago

  • Description updated (diff)
Actions #2

Updated by Gerrit Code Review 10 months ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80104

Actions #3

Updated by Gerrit Code Review 10 months ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80104

Actions #4

Updated by Gerrit Code Review 10 months ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80104

Actions #5

Updated by Gerrit Code Review 10 months ago

Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80133

Actions #6

Updated by Torben Hansen 10 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Stefan Bürk about 2 months ago

  • Related to Bug #103531: Ensure correct access for LazyLoadingProxy test added
Actions

Also available in: Atom PDF