From 00cb672bf54709d65d73e7aa01ea531c50b05bca Mon Sep 17 00:00:00 2001 From: Aram Balakjian Date: Mon, 23 Mar 2015 17:58:53 +0000 Subject: [PATCH] Changed instantiation of controller to ::create --- code/extensions/CommentsExtension.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/extensions/CommentsExtension.php b/code/extensions/CommentsExtension.php index baffb25..53065db 100644 --- a/code/extensions/CommentsExtension.php +++ b/code/extensions/CommentsExtension.php @@ -107,17 +107,17 @@ class CommentsExtension extends DataExtension { // do not include the comments on pages which don't have id's such as security pages if($this->owner->ID < 0) return false; - - $controller = new CommentingController(); + + $controller = CommentingController::create(); $controller->setOwnerRecord($this->owner); $controller->setBaseClass($this->ownerBaseClass); $controller->setOwnerController(Controller::curr()); $moderatedSubmitted = Session::get('CommentsModerated'); Session::clear('CommentsModerated'); - + $form = ($enabled) ? $controller->CommentsForm() : false; - + // a little bit all over the show but to ensure a slightly easier upgrade for users // return back the same variables as previously done in comments return $interface->process(new ArrayData(array(