DDC-2579: BasicEntityPersister - delete bug #3236

Closed
opened 2026-01-22 14:16:17 +01:00 by admin · 3 comments
Owner

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.

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(<ins>id</ins>,name) Person(<ins>user_id</ins>,birthdate) Email(<ins>user_id</ins>, <ins>email</ins>) 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.
admin added the Bug label 2026-01-22 14:16:18 +01:00
admin closed this issue 2026-01-22 14:16:18 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jul 30, 2013):

Comment created by @FabioBatSilva:

Fixed : 7055ccbf9b

@doctrinebot commented on GitHub (Jul 30, 2013): Comment created by @FabioBatSilva: Fixed : https://github.com/doctrine/doctrine2/commit/7055ccbf9bc9bd72b184734bcbeb72e682bf642b
Author
Owner

@doctrinebot commented on GitHub (Jul 30, 2013):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Jul 30, 2013): Issue was closed with resolution "Fixed"
Author
Owner

@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.

@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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#3236