From d0cd57104d704a751d01b0406d6e9751b667c2af Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Fri, 24 Apr 2015 14:28:40 +1200 Subject: [PATCH] BUG FIx "your comment is awaiting moderation" and "your comment is rejected as spam" messages appearing together. --- code/controllers/CommentingController.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/controllers/CommentingController.php b/code/controllers/CommentingController.php index 789f6ba..ca1bf3a 100644 --- a/code/controllers/CommentingController.php +++ b/code/controllers/CommentingController.php @@ -529,11 +529,6 @@ class CommentingController extends Controller { $requireModeration = false; break; } - - // we want to show a notification if comments are moderated - if ($requireModeration) { - Session::set('CommentsModerated', 1); - } $comment = new Comment(); $form->saveInto($comment); @@ -552,6 +547,11 @@ class CommentingController extends Controller { // extend hook to allow extensions. Also see onBeforePostComment $this->extend('onAfterPostComment', $comment); } + + // we want to show a notification if comments are moderated + if ($requireModeration && !$comment->IsSpam) { + Session::set('CommentsModerated', 1); + } // clear the users comment since it passed validation Cookie::set('CommentsForm_Comment', false);