summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2010-01-24 22:08:59 -0800
committerTim Almdal <tnalmdal@shaw.ca>2010-01-24 22:08:59 -0800
commit445295a1ed8eb7dfc1caacfcb4211c312daaf257 (patch)
treef75ea39e60eeed11b1082d33e887a4bfbf277492
parent865995305cbd709db4f8587d73e7178a277a8d8b (diff)
Insure that if original() is called and no original has been created, then create it before returning. Fixes ticket #989.
-rw-r--r--modules/gallery/libraries/MY_ORM.php3
1 files changed, 3 insertions, 0 deletions
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;
}
}