mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
Setting the http error to come from the request handler, and the session coming form the Request objects. Just small bugs fix's so the comment form works with ss4.
This commit is contained in:
parent
532b49c537
commit
abb45aa733
@ -183,7 +183,7 @@ class CommentForm extends Form
|
|||||||
$this->controller->setOwnerRecord($class::get()->byID($data['ParentID']));
|
$this->controller->setOwnerRecord($class::get()->byID($data['ParentID']));
|
||||||
}
|
}
|
||||||
if (!$this->controller->getOwnerRecord()) {
|
if (!$this->controller->getOwnerRecord()) {
|
||||||
return $this->httpError(404);
|
return $this->getRequestHandler()->httpError(404);
|
||||||
}
|
}
|
||||||
|
|
||||||
// cache users data
|
// cache users data
|
||||||
@ -246,7 +246,7 @@ class CommentForm extends Form
|
|||||||
|
|
||||||
// we want to show a notification if comments are moderated
|
// we want to show a notification if comments are moderated
|
||||||
if ($requireModeration && !$comment->IsSpam) {
|
if ($requireModeration && !$comment->IsSpam) {
|
||||||
Session::set('CommentsModerated', 1);
|
$this->getRequest()->getSession()->set('CommentsModerated', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear the users comment since it passed validation
|
// clear the users comment since it passed validation
|
||||||
|
Loading…
Reference in New Issue
Block a user