mirror of
https://github.com/doctrine/orm.git
synced 2026-04-27 00:18:04 +02:00
DDC-3222: PostUpdate event destroying collectionUpdates #3987
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 (Jul 21, 2014).
Originally assigned to: @Ocramius on GitHub.
Jira issue originally created by user jspizziri:
I have an entity that contains a Many-To-Many Unidirectional association. When the association is updated and the entity is flushed the changes are not being persisted to the database.
This is because the postUpdate event is being fired on executeUpdates, which is being called before the collection updates are being processed here:
This is occurring in UnitOfWork->commit() lines 333 through 366.
Apparently the postUpdate listener I wrote was causing the collectionUpdates property to be erased.
@doctrinebot commented on GitHub (Jul 21, 2014):
Comment created by @ocramius:
What does the listener actually do? Doesn't look like a bug to me...
@doctrinebot commented on GitHub (Jul 21, 2014):
Comment created by jspizziri:
I'm using FOSElasticaBundle/ElasticSearch. On the postUpdate event I'm calling fos:elastica:populate on the entity indexes. Heres the code
Am I using this event incorrectly? Should I only be using postPersist?
@doctrinebot commented on GitHub (Sep 17, 2014):
Comment created by @ocramius:
After checking again, I think this issue is invalid. Please use the
onFlushevent to log changes (instead ofpost-*events@doctrinebot commented on GitHub (Sep 17, 2014):
Issue was closed with resolution "Invalid"