Review main Merged

80104[BUGFIX] Harden Extbase LazyLoadingProxy

Torben Hansen 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

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 4