From 445295a1ed8eb7dfc1caacfcb4211c312daaf257 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sun, 24 Jan 2010 22:08:59 -0800 Subject: Insure that if original() is called and no original has been created, then create it before returning. Fixes ticket #989. --- modules/gallery/libraries/MY_ORM.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/gallery/libraries/MY_ORM.php b/modules/gallery/libraries/MY_ORM.php index 56c776aa..198a430b 100644 --- a/modules/gallery/libraries/MY_ORM.php +++ b/modules/gallery/libraries/MY_ORM.php @@ -49,6 +49,9 @@ class ORM extends ORM_Core { } public function original() { + if (!isset($this->original)) { + $this->original = clone $this; + } return $this->original; } } -- cgit v1.2.3