summaryrefslogtreecommitdiff
path: root/modules/comment
diff options
context:
space:
mode:
authorNathan Kinkade <nkinkade@nkinka.de>2010-01-19 16:34:34 +0000
committerNathan Kinkade <nkinkade@nkinka.de>2010-01-19 16:34:34 +0000
commite47505081f2c1017a68f763e1170b44fddd1e722 (patch)
treeeb511a8d9bae266ed6cf86f789f270642af93e90 /modules/comment
parent0a67b836a9b5021c91b9c327d3693991c3248dfc (diff)
parent9384f987bb96d0d39787ff9d3d16a70c01cd76e0 (diff)
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/comment')
-rw-r--r--modules/comment/controllers/admin_comments.php5
-rw-r--r--modules/comment/models/comment.php4
2 files changed, 6 insertions, 3 deletions
diff --git a/modules/comment/controllers/admin_comments.php b/modules/comment/controllers/admin_comments.php
index 880c33a7..b7dc5fb3 100644
--- a/modules/comment/controllers/admin_comments.php
+++ b/modules/comment/controllers/admin_comments.php
@@ -121,9 +121,10 @@ class Admin_Comments_Controller extends Admin_Controller {
public function delete_all_spam() {
access::verify_csrf();
- ORM::factory("comment")
+ db::build()
+ ->delete("comments")
->where("state", "=", "spam")
- ->delete_all();
+ ->execute();
url::redirect("admin/comments/queue/spam");
}
}
diff --git a/modules/comment/models/comment.php b/modules/comment/models/comment.php
index 59b85233..e0b82039 100644
--- a/modules/comment/models/comment.php
+++ b/modules/comment/models/comment.php
@@ -65,12 +65,14 @@ class Comment_Model extends ORM {
}
}
$visible_change = $this->original()->state == "published" || $this->state == "published";
+
+ $original = clone $this->original();
parent::save();
if (isset($created)) {
module::event("comment_created", $this);
} else {
- module::event("comment_updated", $this->original(), $this);
+ module::event("comment_updated", $original, $this);
}
// We only notify on the related items if we're making a visible change.