mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-345: Lifecycle callbacks break properties on cascade=persist #427
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?
Originally created by @doctrinebot on GitHub (Feb 17, 2010).
Jira issue originally created by user nicokaiser:
When I try to create an association entity for a ManyToMany association (e.g. Users, Groups and an associating Membership entity that holds some more properties than just userId and groupId), I use cascade={"persist"} in the @OneToMany annotations for Users and Groups.
Membership also has Lifecycle callbacks (e.g. for setting an "updated" property). Now when I add the Membership object to the User and Group objects, its Lifecycle callbacks are called more than one time, and when it's called the second time, all properties but the ones set by the callback function are unset.
Complete example: http://pastie.org/828718
Script output: http://pastie.org/828727
@doctrinebot commented on GitHub (Feb 17, 2010):
Comment created by nicokaiser:
Maybe this is related to DDC-74?
@doctrinebot commented on GitHub (Feb 23, 2010):
Comment created by romanb:
Should be fixed now, was a state issue. Thanks for the full example, that made it easy to create a test case.
@doctrinebot commented on GitHub (Feb 23, 2010):
Issue was closed with resolution "Fixed"