Merge pull request #257 from creative-commoners/pulls/3.1/reply-bug

FIX Bug with requiring login when posting a comment, pass correct controller in
This commit is contained in:
Robbie Averill 2018-06-20 14:28:22 +12:00 committed by GitHub
commit f357ca6b7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@
namespace SilverStripe\Comments\Forms;
use SilverStripe\Control\HTTPResponse;
use SilverStripe\Forms\CompositeField;
use SilverStripe\Forms\EmailField;
use SilverStripe\Forms\FieldList;
@ -192,7 +193,7 @@ class CommentForm extends Form
// If commenting can only be done by logged in users, make sure the user is logged in
if (!$this->controller->getOwnerRecord()->canPostComment()) {
return Security::permissionFailure(
$this,
$this->controller,
_t(
'SilverStripe\\Comments\\Controllers\\CommentingController.PERMISSIONFAILURE',
"You're not able to post comments to this page. Please ensure you are logged in and have an "