Review 12.4 Merged

83658[BUGFIX] Ensure correct access for LazyLoadingProxy test

Stefan Bürk CR +2 V +2 Easy +13 −3 updated 04/04/24, 09:51

Commit message

To harden the Extbase LazyLoadingProxy implementation
a new test has been added with #101400, which creates
a proxy directly and using ObjectAccess::getProperty()
to access a property of the not loadable child proxy
class instance.

Due to the use of magic methods`__get()` and `__isset()`
methods in the `LazyLoadingProxy` class and some wrong
assumptions of the Symfony PropertyAccessor simply null
has been retrieved even if the concrete class could not
been retrieved (property on a null value instead of an
object). The property accessor is used under the hood
within the Extbase internal ObjectAccess implementation.

The Symfony Team recently declared that behaviour a bug
and fixed it with releases `7.0.6` and `6.4.6` and now
correctly throwing the `PropertyNotAccessibleException`.

Failing nightlies with Symfony releases containing the
bugfix revealed a incorrect test implementation, using
a constructed and unrealistic construct.

This change modifies the test to use a correct access
on the LazyLoadingProxy without changing the scenario
of the test.

[1] https://github.com/symfony/symfony/releases/tag/v7.0.6
[2] https://github.com/symfony/symfony/releases/tag/v6.4.6
[3] https://github.com/symfony/symfony/pull/54194

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
  • Verified V +2 Done
    • Stefan Bürk +2
    • core-ci +1 CI

Issues 2

Files 1

Review log 34

  1. Stefan Bürk commented on patch set 1 04/04/24, 09:33

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 04/04/24, 09:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55327

  3. Stefan Bürk voted on patch set 1 CR +2 V +2 04/04/24, 09:51

  4. Stefan Bürk merged patch set 2 04/04/24, 09:51