From 886c5be21aad47198630daee4e8cb3325fd74421 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Wed, 20 Jun 2018 14:20:50 +1200 Subject: [PATCH] FIX Bug with requiring login when posting a comment, pass correct controller in --- src/Forms/CommentForm.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Forms/CommentForm.php b/src/Forms/CommentForm.php index 5e875ce..edee7de 100644 --- a/src/Forms/CommentForm.php +++ b/src/Forms/CommentForm.php @@ -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 "