mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-2579: BasicEntityPersister - delete bug #3236
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 29, 2013).
Jira issue originally created by user honzap:
I think, in BasicEntityPersister is bug in detecting types:
https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php#L583
The $types array is not defined inside closure function. This makes problem with deleting entity with two and more primary keys which one of them references to another entity with reference too.
My relationship (example):
User(id,name)
Person(user_id,birthdate)
Email(user_id, email) but FK (and @manyToOne relation) on user_id field references to Person table/entity, not User. FK in Person entity references to User of course.
Trying delete the Email entity record throws exception based a few lines later.
@doctrinebot commented on GitHub (Jul 30, 2013):
Comment created by @FabioBatSilva:
Fixed :
7055ccbf9b@doctrinebot commented on GitHub (Jul 30, 2013):
Issue was closed with resolution "Fixed"
@doctrinebot commented on GitHub (Jul 30, 2013):
Comment created by honzap:
I agree with fix. I've done the same at my local repo and it works well. Thanks for confirmation.