[MODM-140] Issue with nested embdedded documents after adding an EmbeddedDocument to Document Created: 14/Apr/11 Updated: 19/Dec/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | UnitOfWork |
| Affects Version/s: | 1.0.0BETA3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Andrew Cobby | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 5 |
| Labels: | None | ||
| Environment: |
PHP 5.3.3, Mac OS X 10.6.6, MongoDB 1.8.0 |
||
| Attachments: |
|
| Description |
|
I'm using the latest version of Doctrine ODM (fresh from Git). I have three levels of Documents (Two embedded); Category -> EmbedsMany: Post -> EmbedsMany PostVersion. Step-by-step: 1. Make a new Post (Post1), 2 PostVersions (PostVersion1 and 2) and a Category If you're following properly, at this stage in the database there should be: However, what actually happens is: On StackOverflow: http://bit.ly/ekFbe2 A work around is to make Post2 and add it to Category, flush, then make new PostVersions and flush again. I did some debugging but I don't know enough about the internals to fix the issue. |
| Comments |
| Comment by Andrew Cobby [ 14/Apr/11 ] |
|
Failing test |
| Comment by Andrew Cobby [ 14/Apr/11 ] |
|
Added a test using the EmbdeddedTestLevelX Documents, please refer to Gist: https://gist.github.com/920914 For some reason, they work? I'm thinking maybe this isn't a bug... very confused at the moment. |
| Comment by Andras Revai [ 18/Jun/11 ] |
|
I've got the same problem. |
| Comment by Kelvin Wood [ 09/Aug/11 ] |
|
I had a similar problem, and resolved it with the attached patch (based on the 1.0.0beta3 release). This patch causes the ODM to stop scanning for changes further down the heirachy once it finds a new object, and then ensures that the Persistence Builder will include all contents of the new item. |
| Comment by Richard Shank [ 19/Dec/11 ] |
|
Kevin, do you want to put a PR in on github for this? |