From 90d5393e5f7ef9e0b387e4da49fa2c5665ced7f6 Mon Sep 17 00:00:00 2001 From: AlexeyDsov Date: Thu, 24 May 2012 11:34:02 +0400 Subject: [PATCH] StorableDao: fix merging object with self --- doc/ChangeLog | 4 ++++ main/DAOs/StorableDAO.class.php | 2 ++ 2 files changed, 6 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 26e4436ac4..b18ef825f1 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2012-05-31 Alexey S. Denisov + + * main/DAOs/StorableDAO.class.php: fix merging object with self + 2012-05-28 Georgiy T. Kutsurua * core/Cache/PeclMemcache.class.php diff --git a/main/DAOs/StorableDAO.class.php b/main/DAOs/StorableDAO.class.php index 4787790be7..6d24b923c5 100644 --- a/main/DAOs/StorableDAO.class.php +++ b/main/DAOs/StorableDAO.class.php @@ -67,6 +67,8 @@ public function merge(Identifiable $object, $cacheOnly = true) else $old = Cache::worker($this)->getById($object->getId()); } + if ($object === $old) + return $this->save($object); return $this->unite($object, $old); }