doctrine/mongodb-odm — pull request #332 by superdweebie (2012-06-22 04:43:48+00:00)
Title: Incomplete fix for original data problem - DO NOT MERGE

Hey,

I've come across a bug. If you have a document with a collection, during computation of the changeSet before persist a reference to that collection is placed in originalData, not a copy. Therefore, if you change the collection in an onFlush event listener, then call recomputeSingleDocumentChangeSet, the changes to the collection are not recognised, because the originalData has changed also. The PR here creates a copy of the collection for originaData, which makes my problem go away. However, this change breaks other parts of the test suite. I haven't investivated why yet.

So...perhaps there are some comments/thoughts/wisdom on this?