diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index b340d3c33..e4ce99879 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -1655,7 +1655,7 @@ class UnitOfWork implements PropertyChangedListener $oid = spl_object_hash($entity); if (isset($visited[$oid])) { - return; // Prevent infinite recursion + return $visited[$oid]; // Prevent infinite recursion } $visited[$oid] = $entity; // mark visited