mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-140: hydrateAdd does not update originalEntityData #174
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 @doctrinebot on GitHub (Nov 12, 2009).
Jira issue originally created by user rickdt:
Step to reproduce :
ex :
Client (id, name | emails)
Email(id, email, client_id | clients)
Email is the owning side.
Do a query using both entity
$qb->select('client', 'emails')
->from('Client', 'client')
->leftJoin('client.emails', 'emails')
->where(...);
$query = $qb->getQuery();
$client = $query->getSingleResult();
$em->flush();
If you set listener on onUpdate event, you will notice that the Email entity is updated.
I looked deep into UnitOfWork and ObjectHydrator and I see that the originalEntityData (used to calculate modified data before update) is saved before the manyToMany relation is set by a call to hydrateAdd (ObjectHydrator line 322)
In my previously bug report : DDC-139, I tought I had to check if an entity have changed in the onUpdate. Now, I see that entity are wrongly updated.
I can provide a more detailled test case if you need more informations.
Thank you
@doctrinebot commented on GitHub (Dec 10, 2009):
Comment created by romanb:
Can you check whether this was fixed by DDC-171 already?
If not where is the difference?
@doctrinebot commented on GitHub (Dec 10, 2009):
Comment created by rickdt:
Fixed by DDC-171
@doctrinebot commented on GitHub (Dec 10, 2009):
Issue was closed with resolution "Fixed"