mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
[PR #10806] Fix enum change set recomputation on single entity #12634
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/10806
State: closed
Merged: Yes
The root cause is well explained in #10074 and #10277
These PRs mitigate the issue in
computeChangeSetmethod, but in some casesrecomputeSingleEntityChangeSetmight also be called.One of the cases where
recomputeSingleEntityChangeSetmight be called are in event listeners when you want to modify some other existing entity. Due to the fact thatoriginalEntityDatacontains enum objects andReflectionEnumProperty::getValue()returns value of enum - comparison of values are always falsy, resulting to update column value even though its exactly the same. In case nothing changed in entity it can even result to additional queries to DB if entity contains enum attribute