From bf32125badc78b2749e1d47470bc2df2d4adec7a Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Mon, 19 Dec 2011 17:55:19 +0100 Subject: [PATCH] DDC-1545 - Fix issue with changing values from null to something new. This issue was introduced by a side-effect in 2.1.3 with d9f9228d95c5ab2a200b3e2d2b358c598267afb1. In this commit read-only objects where prevented to be updated. This lead to an invalid check not being performed in UnitOfWork#computeChangeSet which was present before where an association that was null would be injected into the originalEntityData using the UnitOfWork#setOriginalEntityProperty() method in the AbstractHydrator. This commit now explicitly sets this field to null using the same API so that is present during UnitOfWork#computeChangeSet. --- lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php index f7de28538..1935e901d 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php @@ -443,6 +443,8 @@ class ObjectHydrator extends AbstractHydrator } // Update result pointer $this->_resultPointers[$dqlAlias] = $element; + } else { + $this->_uow->setOriginalEntityProperty($oid, $relationField, null); } // else leave $reflFieldValue null for single-valued associations } else {