[MODM-134] Reference added twice Created: 24/Mar/11  Updated: 25/Mar/11

Status: Open
Project: Doctrine MongoDB ODM
Component/s: None
Affects Version/s: 1.0.0BETA3
Fix Version/s: None

Type: Bug Priority: Major
Reporter: jules b Assignee: Jonathan H. Wage
Resolution: Unresolved Votes: 0
Labels: None


 Description   

I have a listener who listens on onFlush event,
i have a document and change a property (integer) in it and call $uow->recomputeSingleDocumentChangeSet().
The result is that all references are added twice.

If i remove the call to $uow->recomputeSingleDocumentChangeSet() all is fine.

Here's my document (notice references added twice on children property):

array (
'children' =>
array (
0 =>
array (
'$ref' => 'block',
'$id' => new MongoId("4d8b663638b6180803000005"),
'$db' => 'app_jules',
'_doctrine_class_name' => 'Design\\PageBundle\\Document
StrategyBlock',
),
1 =>
array (
'$ref' => 'block',
'$id' => new MongoId("4d8b663638b6180803000005"),
'$db' => 'app_jules',
'_doctrine_class_name' => 'Design\\PageBundle\\Document
StrategyBlock',
)
),
'order' => 0,
'parent' =>
array (
'$ref' => 'block',
'$id' => new MongoId("4d8b663638b6180803000003"),
'$db' => 'app_jules',
'_doctrine_class_name' => 'Design\\PageBundle\\Document
ContainerBlock',
),
'type' => 'container',
)

EDIT: if i clear() the $children ArrayCollection before calling $uow->recomputeSingleDocumentChangeSet() all is fine

I tried to reproduce it in a test-case but the result wasn't successful


Generated at Fri Aug 01 12:07:53 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.