From 2aa8d974b039b558eaf90ea04be4cf17679e4322 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Thu, 30 Apr 2015 14:34:57 +1200 Subject: [PATCH] BUG Fix redirection on moderated & spam comments --- code/controllers/CommentingController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/controllers/CommentingController.php b/code/controllers/CommentingController.php index ca1bf3af..700e7788 100644 --- a/code/controllers/CommentingController.php +++ b/code/controllers/CommentingController.php @@ -566,13 +566,13 @@ public function doPostComment($data, $form) { } // Given a redirect page exists, attempt to link to the correct anchor - if(!$comment->Moderated) { + if($comment->IsSpam) { + // Link to the form with the error message contained + $hash = $form->FormName(); + } else if(!$comment->Moderated) { // Display the "awaiting moderation" text $holder = $this->getOption('comments_holder_id'); $hash = "{$holder}_PostCommentForm_error"; - } elseif($comment->IsSpam) { - // Link to the form with the error message contained - $hash = $form->FormName(); } else { // Link to the moderated, non-spam comment $hash = $comment->Permalink();