Skip to content
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.

DC-797 - Record hydrated as dirty if optional relation is empty #8

Closed
wants to merge 4 commits into from
Closed

Conversation

dominics
Copy link
Contributor

Contains fix for http://www.doctrine-project.org/jira/browse/DC-797 - still very much an issue.

Apologies if you've seen this request before. This one is done correctly, in a topic branch.

All tests seem to pass; one had to be slightly modified, but it really was, as far as I can see, the fault of the test. More details about that in the commit message (d6260c0).

Records containing an empty one-to-one relation are hydrated as dirty/modified
This patch modifies the record's _isValueModified method to mark
a change from null to Doctrine_Null (or vice versa) as not a
modification.
Setting Translation properties doesn't seem to mark a record as
modified. So, this test case previously marked the Place as TDIRTY, so
that it would be saved. However, this test case didn't set the Sura to
TDIRTY.

Now that DC-797 is fixed, and the Sura is no longer marked as TDIRTY by
setting a related Place, the state must be set on both the Sura and the
Place.
Currently, count(new Doctrine_Null()) returns 1. This means
Doctrine_Hydrator_RecordDriver::setLastElement() will try to call
getLast() on instances of Doctrine_Null and fail.

Compare this to count(null), which gives 0: if Doctrine_Null is
to represent null it should give the same count.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants