[MODM-85] Saving a array over the top of a PersistentCollection results in duplicated data Created: 08/Oct/10  Updated: 24/Nov/10  Resolved: 24/Nov/10

Status: Resolved
Project: Doctrine MongoDB ODM
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0.0BETA2

Type: Bug Priority: Critical
Reporter: Andy Stanberry Assignee: Jonathan H. Wage
Resolution: Fixed Votes: 0
Labels: None
Environment:

Mongo 1.6.1, opensky/mongo-odm/master



 Description   

If you take an document that has a referenceMany and overwrite a PersistentCollection of data with an array, even of the same data, the data is appended to the collection instead of replacing it.



 Comments   
Comment by Sebastian Hoitz [ 12/Oct/10 ]

Are you using the most recent version of Doctrine MongoDB ODM?

I'm asking because there was a bug fix for something where all embedded documents were duplicated.

However I'm also currently investigating a bug where in some cases only one entry does not get removed (although $pullAll is called correctly).

Comment by Jonathan H. Wage [ 19/Oct/10 ]

Bulat, this is the same issue where PersistentCollection is never initialized so thats why the array_diff always appends the data with a $pushAll. Remember we talked about it? we can fix it just need to chat about it for a bit.

Comment by Jonathan H. Wage [ 24/Nov/10 ]

This is not a problem anymore after the recent refactoring!

Generated at Mon Dec 22 17:11:22 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.