mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
OneToOne relation is not updated if proxy is loaded afterwords #6548
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @aurelijusrozenas on GitHub (Sep 23, 2020).
Hi,
TLDR; If parent->child relation is changed when child is still proxy object, and then child proxy is loaded, it will reset parent->child relation to previous state. Run the tests and check the failing test.
I stumbled on some interesting bug. After chasing it for a while I managed to reproduce it and since there is no explanation in the docs that it is the intended functionality I think it's a bug.
How to reproduce it:
Now, I do not know how to proceed with problem in my code with similar situation because in my mind I should not worry about whether the entity is proxy or not, the outcome should be always the same. Please help me because I am going crazy... :)
I added test:
a6f67ceba5Try it out:
P.S. The test itself is pretty crappy, sorry about that, you must run one test at a time, not the whole file. It does show the problem though.
I tried multiple doctrine versions, it seems the outcome is always the same.