Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix for DC-797, 1-to-1 (or-none) hydrated dirty

Don't consider a change from null to Doctrine_Null to be a value
modification
  • Loading branch information...
commit 93f01b7c81997b1e87100bfb4e0f7cebcce40ee8 1 parent 1ccee08
@dominics dominics authored jwage committed
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/Doctrine/Record.php
View
4 lib/Doctrine/Record.php
@@ -1537,6 +1537,10 @@ protected function _isValueModified($type, $old, $new)
return true;
}
+ if (($old === null || $old instanceof Doctrine_Null) && ($new == null || $new instanceof Doctrine_Null)) {
+ return false;
+ }
+
if ($type == 'boolean' && (is_bool($old) || is_numeric($old)) && (is_bool($new) || is_numeric($new)) && $old == $new) {
return false;
} else if (in_array($type, array('decimal', 'float')) && is_numeric($old) && is_numeric($new)) {

3 comments on commit 93f01b7

@jwage
Owner

I have to revert this commit as it actually causes the test suite to fail.

@dominics

It looks like the rest of my pull request wasn't committed:
#8

One test is specifically addressed in the pull request:
dominics/doctrine1@d6260c0

And I wouldn't expect the whole suite to pass without this one too:
dominics/doctrine1@754ca89

The rationale for those changes is elaborated in their commit messages.

If any other tests are failing with those changes applied, I'd be happy to take another look.

@dominics

Oh, and more importantly, this commit is incorrect. This change is the correct one, which is the one attached to my topic branch pull request:
dominics/doctrine1@9e08e27

NB: === versus == in the second half of the conditional

Please sign in to comment.
Something went wrong with that request. Please try again.