Hi,
in the PageComment.php, the $comment should be checked for null value (someone can delete the comment, while the other people view it.)
--- PageComment.php.orig 2007-06-18 15:35:32.000000000 +1200
+++ PageComment.php 2007-06-18 15:38:12.000000000 +1200
@@ -25,8 +25,10 @@
$member = Member::currentUser();
if($member && $member->isCMSUser()) {
$comment = DataObject::get_by_id("PageComment", $this->urlParams['ID']);
+ if ($comment) {
$comment->delete();
}
+ }
if(Director::is_ajax()) {
echo "";
@@ -62,6 +64,7 @@
if(SSAkismet::isEnabled() && $member && $member->isCMSUser()) {
$comment = DataObject::get_by_id("PageComment", $this->urlParams['ID']);
+ if ($comment) {
try {
$akismet = new SSAkismet();
$akismet->setCommentAuthor($comment->getField('Name'));
@@ -79,6 +82,7 @@
$comment->delete();
}
}
+ }
if(Director::is_ajax()) {
if(SSAkismet::getSaveSpam()) {
@@ -95,7 +99,7 @@
$member = Member::currentUser();
if(SSAkismet::isEnabled() && $member && $member->isCMSUser()) {
$comment = DataObject::get_by_id("PageComment", $this->urlParams['ID']);
-
+ if ($comment) {
try {
$akismet = new SSAkismet();
$akismet->setCommentAuthor($comment->getField('Name'));
@@ -109,6 +113,7 @@
$comment->setField('IsSpam', false);
$comment->write();
}
+ }
if(Director::is_ajax()) {
echo $comment->renderWith('PageCommentInterface_singlecomment');