mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
Merge pull request #123 from tractorcow/pulls/2.0/fix-spam-moderation
BUG Fix "your comment is awaiting moderation" and "your comment is rejected as spam" messages appearing together.
This commit is contained in:
commit
304dee2792
@ -529,11 +529,6 @@ class CommentingController extends Controller {
|
|||||||
$requireModeration = false;
|
$requireModeration = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// we want to show a notification if comments are moderated
|
|
||||||
if ($requireModeration) {
|
|
||||||
Session::set('CommentsModerated', 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
$comment = new Comment();
|
$comment = new Comment();
|
||||||
$form->saveInto($comment);
|
$form->saveInto($comment);
|
||||||
@ -552,6 +547,11 @@ class CommentingController extends Controller {
|
|||||||
// extend hook to allow extensions. Also see onBeforePostComment
|
// extend hook to allow extensions. Also see onBeforePostComment
|
||||||
$this->extend('onAfterPostComment', $comment);
|
$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
|
// clear the users comment since it passed validation
|
||||||
Cookie::set('CommentsForm_Comment', false);
|
Cookie::set('CommentsForm_Comment', false);
|
||||||
|
Loading…
Reference in New Issue
Block a user