diff --git a/ext/comment/main.php b/ext/comment/main.php index 09aa199b..5ce56211 100644 --- a/ext/comment/main.php +++ b/ext/comment/main.php @@ -162,6 +162,7 @@ class CommentList extends SimpleExtension { public function onImageDeletion($event) { global $database; + $image_id = $event->image->id; $database->Execute("DELETE FROM comments WHERE image_id=?", array($image_id)); log_info("comment", "Deleting all comments for Image #$image_id"); } diff --git a/ext/comment/test.php b/ext/comment/test.php index c31555de..b9c11330 100644 --- a/ext/comment/test.php +++ b/ext/comment/test.php @@ -68,6 +68,10 @@ class CommentListTest extends ShimmieWebTestCase { $this->log_in_as_admin(); $this->delete_image($image_id); $this->log_out(); + + $this->get_page('comment/list'); + $this->assert_title('Comments'); + $this->assert_no_text('ASDFASDF'); } function testSingleDel() {