diff --git a/lib/Doctrine/Connection/UnitOfWork.php b/lib/Doctrine/Connection/UnitOfWork.php index b348943b1..bab89e0ec 100644 --- a/lib/Doctrine/Connection/UnitOfWork.php +++ b/lib/Doctrine/Connection/UnitOfWork.php @@ -221,11 +221,15 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module } else { // ONE-TO-ONE relationship $obj = $record->get($rel->getAlias()); - $obj->save($this->conn); - } + // Protection against infinite function recursion before attempting to save + if ($obj->isModified()) { + $obj->save($this->conn); + } + } } } + return $saveLater; } /**