mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
Changed instantiation of controller to ::create
This commit is contained in:
parent
99cf501393
commit
00cb672bf5
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user