mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
UnitOfWork::getScheduledEntityUpdates doesn't return the correct entity state #6378
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 @pmishev on GitHub (Jan 8, 2020).
Bug Report
Summary
When I call
$unitOfWork->getScheduledEntityUpdates()in an onFlush subscriber, I expect to get the entity with its relations calculated, but I am getting an old state of that entity in my caseHow to reproduce
In my controller I have:
In my subscriber:
As an output from the dumps, I expect to get:
But the output I get is:
NOTE: If I uncomment the 2 commented lines in the code above, I get the correct output that I expect.
@pmishev commented on GitHub (Jan 10, 2020):
Never mind.. turned out some other subscriber was calling $em->refresh() on the entity and messing it up