DDC-2645: merge() not dealing correctly with composite primary keys #3319

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

Originally created by @doctrinebot on GitHub (Sep 2, 2013).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user papoola:

$entity=$em->merge($entity);

fails for entity with composite keys:
http://pastebin.com/iz6UACf9


Calling flattenIdentifier() from:

returns only array of foreign keys (integer primary key ignored)

Causing this exception to be thrown:

Originally created by @doctrinebot on GitHub (Sep 2, 2013). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user papoola: $entity=$em->merge($entity); fails for entity with composite keys: http://pastebin.com/iz6UACf9 --- Calling flattenIdentifier() from: - https://github.com/doctrine/doctrine2/blob/2.3.4/lib/Doctrine/ORM/UnitOfWork.php#L1775 returns only array of foreign keys (integer primary key ignored) Causing this exception to be thrown: - https://github.com/doctrine/doctrine2/blob/2.3.4/lib/Doctrine/ORM/UnitOfWork.php#L1778 - https://github.com/doctrine/doctrine2/blob/2.3.4/lib/Doctrine/ORM/EntityManager.php#L380
admin added the Bug label 2026-01-22 14:17:57 +01:00
admin closed this issue 2026-01-22 14:17:57 +01:00
Author
Owner

@doctrinebot commented on GitHub (Sep 20, 2013):

Comment created by papoola:

I haven't seen any comments or progress on this issue.

So I came up with a fix for flattenIdentifier my self:
http://pastebin.com/hvVRaU8z

Can this be pushed to repos once its validated?

@doctrinebot commented on GitHub (Sep 20, 2013): Comment created by papoola: I haven't seen any comments or progress on this issue. So I came up with a fix for **flattenIdentifier** my self: http://pastebin.com/hvVRaU8z Can this be pushed to repos once its validated?
Author
Owner

@doctrinebot commented on GitHub (Dec 2, 2013):

Comment created by lhess:

Same problem here, please fix this issue asap! :-))

@doctrinebot commented on GitHub (Dec 2, 2013): Comment created by lhess: Same problem here, please fix this issue asap! :-))
Author
Owner

@doctrinebot commented on GitHub (Dec 15, 2013):

Comment created by @beberlei:

Fixed and merged for 2.4.2

@doctrinebot commented on GitHub (Dec 15, 2013): Comment created by @beberlei: Fixed and merged for 2.4.2
Author
Owner

@doctrinebot commented on GitHub (Dec 15, 2013):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Dec 15, 2013): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#3319