From 93f01b7c81997b1e87100bfb4e0f7cebcce40ee8 Mon Sep 17 00:00:00 2001 From: Dominic Scheirlinck Date: Thu, 16 Sep 2010 13:15:24 +1200 Subject: [PATCH] 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 --- lib/Doctrine/Record.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Doctrine/Record.php b/lib/Doctrine/Record.php index d30276958..72dc581f7 100644 --- a/lib/Doctrine/Record.php +++ b/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)) {