Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 2.0-ALPHA3
-
Fix Version/s: 2.0-ALPHA4
-
Component/s: ORM
-
Security Level: All
-
Labels:None
Description
Step to reproduce :
1) create Two entity with bidirectionnal oneToMany association.
ex :
Client (id, name | emails)
Email(id, email, client_id | clients)
Email is the owning side.
2) 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();
3) 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
Can you check whether this was fixed by
DDC-171already?If not where is the difference?