mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #7318] Original entity data is missing id when computing change set for already managed entity #10422
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?
Original Pull Request: https://github.com/doctrine/orm/pull/7318
State: closed
Merged: No
I'm targeting 2.6 branch because it's a bugfix.
The bug happens when you persist again a managed entity.
As you can see from the test case - steps to reproduce are pretty simple.
For id:
UnitOfWork::computeSingleEntityChangeSet()orUnitOfWork::recomputeSingleEntityChangeSet()directly.For collections:
Id is missing because when populating
$actualDataarray, auto-generated id value is ignored. It makes sense, because user shouldn't be able to set it manually.I made a simple fix, which preserves id contained in original entity data when overwriting original data with
$actualData.