summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-01-20 22:50:20 -0800
committerBharat Mediratta <bharat@menalto.com>2010-01-20 22:50:47 -0800
commit6dc88be6b6828a968409167e9f3c57a1bb9ec79c (patch)
tree824c87251b22a291060100dd20b36eaeb920f5ed
parent00957f79bab42b2323b9fe52425b1e0ed51137ac (diff)
Stop using MY_ORM::original().
-rw-r--r--modules/comment/models/comment.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/comment/models/comment.php b/modules/comment/models/comment.php
index 69b8505e..43c4148f 100644
--- a/modules/comment/models/comment.php
+++ b/modules/comment/models/comment.php
@@ -102,13 +102,14 @@ class Comment_Model extends ORM {
$this->server_remote_host = substr($input->server("REMOTE_HOST"), 0, 64);
$this->server_remote_port = substr($input->server("REMOTE_PORT"), 0, 16);
}
- $visible_change = $this->original()->state == "published" || $this->state == "published";
+
+ $visible_change = $this->state == "published";
parent::save();
module::event("comment_created", $this);
} else {
// Updated comment
- $visible_change = $this->original()->state == "published" || $this->state == "published";
- $original = clone $this->original();
+ $original = ORM::factory("comment")->where("id", "=", $this->id)->find();
+ $visible_change = $original->state == "published" || $this->state == "published";
parent::save();
module::event("comment_updated", $original, $this);
}