[SonataDoctrineORMBundle] Deletion of one-to-many relation fails (even when orphan-removal is set to "true")

49 views
Skip to first unread message

Robert Gründler

unread,
May 21, 2012, 4:59:31 PM5/21/12
to sonata...@googlegroups.com
Hi all,

is anyone using the SonataDoctrineORMBundle on master and has not problems with deleting one-to-many relations?

Even the deletion of images from a SonataMediaBundle gallery fails, so it cant' be a problem with my setup. When deleting an entity from the PersistentCollection in a simple symfony2 controller, the entity is removed correctly.

However, when deleted through the sonata admin, deletion fails.

What i've found out so far is, that the `owner` property in the PersistentCollection is `null` when updating the entity in the SonataAdmin class.

When removing the entity manually, the `owner` is not null, and that's why deletion fails in the Admin class.

The check is done [here](https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/PersistentCollection.php#L392).

If anyone has a hint why this is failing in master, i'd greatly appreciate it.


regards

-robert



Reply all
Reply to author
Forward
0 new messages