Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests and fix for MODM-91 #30

Conversation

weaverryan
Copy link
Contributor

Hey guys-

Ticket here: http://www.doctrine-project.org/jira/browse/MODM-91

Let me know if you have any comments/questions - all of the tests are passing, but this is a fairly fundamental change to how the internal data for embedded documents is stored.

Thanks!

…s null, the data should be set to null (instead of being ignored).

Ignoring the null value entirely causes problems when generating the changeset (causes false positives because of the null field).
Because embedded documents are properly given null values, the persistence needs to be smart to treat an entirely empty embedded document as a "new" value (instead of as an update).

Without this change, test MODM48Test throws the following exception "MongoCursorException: can't append to array using string field name [val]".
@avalanche123
Copy link
Contributor

I see the problem and that this effectively fixes it, so thank you for the fix and the test case.
I'm not in love with the solution, because we still have the change set calculation in the BasicDocumentPersister.
Ideally, we should not need to compare old value vs new one as that all should be done in the UnitOfWork.
Jon, what do you think?

@jwage
Copy link
Member

jwage commented Nov 23, 2010

Thanks I merged your test and it passes now after the recent refactoring!

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants