orm
orm copied to clipboard
Fix the initialization of lazy-ghost proxies with postLoad listeners
PostLoad listeners might initialize values for transient properties, so the proxy should not skip initialization when using transient properties.
Closes https://github.com/doctrine/orm/issues/11524
the failing tests are because the testsuite currently relies on unmapped public properties to track the usage of postLoad listeners. For doctrine/common proxies, public properties were unsupported and were not triggering initialization (public methods were the trigger, and using a public property was allowing to skip using any method), which was a known limitation of the proxy system (meant to be solved by the new system, among other things) For the initial implementation of the lazy-ghost proxies, mapped properties were the trigger, making those tests work as well (as those are unmapped properties). But as this PR is precisely about changing the trigger to be all properties, tests will need a different way to track usage.
Would it make sense to do this only when there are postload listeners? Alternatively, it means we should "skip" the properties used in tests, right?
I wanted to refactor those tests to store the initialization tracking externally, but I haven't done it yet (I kinda forgot this PR)
/cc @priyadi
There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. If you want to continue working on it, please leave a comment.
This pull request was closed due to inactivity.
Is there perhaps an update for this issue?
I haven't had the time to go back at it to update the tests. But I saw that https://github.com/doctrine/orm/pull/11853 had similar needs to update the tests, so I might be able to borrow from it.