Open
Description
Bug Report
Q | A |
---|---|
Version | 2.16.0 till present |
Summary
Doctrine ORM v2.16.0 internally starts to execute all updates by single foreach on single UoW property.
Events firing stays inside foreach.
In every iteration property entityUpdates is unsetted. But if we will have recursive call, that will return us to executeUpdates -- then unsetted in later recursive call update will be exceuted on 1st level call.
Current behavior
Duplicated iteration calls and event firing.
Expected behavior
Iteration that respects unsetted entityUpdates from inner recursion level.
How to reproduce
All details, examples and demos are at https://github.com/garex/doctrine-orm-updates-bug
See github actions and unit tests.
Fix also simple:
foreach ($it = new \ArrayIterator($this->entityUpdates) as $oid => $entity) {
// ...
unset($it[$oid]); // Unset here also needed
unset($this->entities[$oid]);
// ...
}
}
Metadata
Metadata
Assignees
Labels
No labels