mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-635: Snapshot is not being created after loadManyToManyCollection done hydrating #785
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 (Jun 13, 2010).
Jira issue originally created by user sammysnake:
Bug: MySQL error "SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-1' for key 1 " produced by flushing a hydrated entity after adding an entity to it in many-to-many relationship.
My Solution: BasicEntityPersister.php
function loadManyToManyCollection(ManyToManyMapping $assoc, $sourceEntity, PersistentCollection $coll)
704a705
Reproduce:
Entities Used..
@doctrinebot commented on GitHub (Jul 4, 2010):
Comment created by @beberlei:
I cannot reproduce this, can you try to create a PHPUnit testcase similar to those in the tests/Doctrine/Tests/ORM/Functional/Ticket folder that shows the behaviour you described?
@doctrinebot commented on GitHub (Jul 4, 2010):
Comment created by @beberlei:
A test of the following kind does not fail, works correctly:
@doctrinebot commented on GitHub (Jul 4, 2010):
Comment created by @beberlei:
Its correct that no snapshot is made at that point, the lazy load of the collection would be triggered this way, which would be very bad!
The "takeSnapshot" method is called during PersistentCollection::initialize()
@doctrinebot commented on GitHub (Jul 14, 2010):
Comment created by sammysnake:
Unable to reproduce on beta2, magically fixed :)
@doctrinebot commented on GitHub (Jul 14, 2010):
Issue was closed with resolution "Invalid"