Review 12.4 Merged

80133[BUGFIX] Harden Extbase LazyLoadingProxy

Nikita Hovratov CR +2 V +2 Easy +13 −8 updated 07/25/23, 06:59

Commit message

When a domain model object has a lazy loading property (e.g.
relation to another domain model object), the
`AbstractGenericObjectValidator` may fail validation the
domain model, if the database record for the related object
has been deleted.

This change fixes the problem by adding a null safe operator
to the `$realInstance` variable in the magic `__get` call
in LazyLoadingProxy. The return type for `_loadRealInstance`
has been adapted, since the function actually can return
`null`. This allows the removal of an entry in the phpstan
baseline file.

Additionally a todo in `AbstractGenericObjectValidator` has
been removed, since the function actually supports lazy
loading proxies as the initial error shows.

Review

  • Code review CR +2 Done
    • Nikita Hovratov +2
  • Verified V +2 Done
    • Nikita Hovratov +2
    • core-ci +1 CI

Issues 1

Files 4

Review log 34

  1. Nikita Hovratov commented on patch set 1 07/25/23, 06:47

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 07/25/23, 06:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44495

  3. Nikita Hovratov voted on patch set 1 V +2 CR +2 07/25/23, 06:59

  4. Nikita Hovratov merged patch set 2 07/25/23, 06:59