diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2010-01-09 23:57:16 -0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2010-01-09 23:57:16 -0800 |
commit | a11bf295078656612603c1c561e9261555d0c40c (patch) | |
tree | c158e9b44762a9606315bf60d67fe2604ce26291 /modules/comment | |
parent | bd9f945e3f2de4ea2402bd3941dba69c79ddc5a4 (diff) |
Fix for ticket #972 and more. In Kohana 2.4, ORM::delete_all ignores any where
clauses and deletes all the entries in the table unless an array of id's are
passed as the parameter. This fix used the Database_builder to specify any where
conditions. Thanks psvo for find the first one. :-)
Diffstat (limited to 'modules/comment')
-rw-r--r-- | modules/comment/controllers/admin_comments.php | 5 |
1 files changed, 3 insertions, 2 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"); } } |