Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of unmapped properties in proxy objects #2698

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Nov 15, 2024

Q A
Type bug
BC Break no
Fixed issues

Summary

While working on a project that contained unmapped hooked properties, I realised that proxies try to unset these hooked properties, despite them not even being mapped properties. Note that this doesn't mean ODM supports hooked properties - it just removes an edge case where you can't use hooked properties at all, even when they aren't mapped and thus shouldn't be handled by ODM at all.

To work around this issue, when creating a proxy we now also skip all properties of the class that aren't mapped, leaving them set and not triggering initialisation when they are accessed.

@alcaeus alcaeus requested a review from GromNaN November 15, 2024 13:22
@alcaeus alcaeus force-pushed the fix-unmapped-properties-in-proxy branch from a8186c0 to a8500a7 Compare November 15, 2024 13:26
@alcaeus alcaeus merged commit 2748349 into doctrine:2.9.x Nov 18, 2024
16 checks passed
@alcaeus alcaeus deleted the fix-unmapped-properties-in-proxy branch November 18, 2024 12:08
@alcaeus alcaeus added this to the 2.9.1 milestone Nov 18, 2024
@GromNaN GromNaN added the Bug label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants