mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
BUG FIx "your comment is awaiting moderation" and "your comment is rejected as spam" messages appearing together.
This commit is contained in:
parent
651a4e4977
commit
d0cd57104d
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user