Skip to content
Snippets Groups Projects
Commit 8503ba3e authored by Stefan Bürk's avatar Stefan Bürk
Browse files

[BUGFIX] Ensure correct access for LazyLoadingProxy test

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

Resolves: #103531
Related: #101400
Releases: main, 12.4
Change-Id: I5bdd52955af138c1e99b4492c9b5a43839c743cf
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83645


Reviewed-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: default avatarTorben Hansen <derhansen@gmail.com>
Reviewed-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarTorben Hansen <derhansen@gmail.com>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
parent 1865bb78
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment