From 5b3f54429aa01d4647e12c6a2f1010698f70844f Mon Sep 17 00:00:00 2001 From: Jan Kramer Date: Sun, 25 Nov 2012 19:13:32 +0100 Subject: [PATCH] [DDC-2074] Fixed bug regarding clearing PC's without owner When calling clear on a PC that has no owner (e.g. because it was cloned), it can't be deleted as there is no metadata available. In these cases, it shouldn't be scheduled for deletion. --- lib/Doctrine/ORM/PersistentCollection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/PersistentCollection.php b/lib/Doctrine/ORM/PersistentCollection.php index ec973408d..8c306f4ab 100644 --- a/lib/Doctrine/ORM/PersistentCollection.php +++ b/lib/Doctrine/ORM/PersistentCollection.php @@ -655,7 +655,7 @@ final class PersistentCollection implements Collection, Selectable $this->initialized = true; // direct call, {@link initialize()} is too expensive - if ($this->association['isOwningSide']) { + if ($this->association['isOwningSide'] && $this->owner) { $this->changed(); $uow->scheduleCollectionDeletion($this);