mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #5570] Fix PrePersist EventListener when using merge instead of persist #9648
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/5570
State: closed
Merged: No
The merge operation trigger PRE_PERSIST & POST_PERSIST events when we merge a new entity.
The bug that I encounter, is that the PRE_PERSIST event is trigger with the managed copy empty ! I that case my event listener can't access original data.
In order to fix this, I firstly merge entity state into managed copy. I think this is not the best move as it will be copied a second time at line 1888.
I tried to persist after this is done, but it break some unit tests.