Skip to content
Permalink
Browse files

FIX Regression in using template_main to render the Security area

* Introduced in 0cf477d
* Should use the "template_main" static to decide which model to use for rendering this page
* Assuming SiteTree means any requirements added in Page and assumed to work everywhere will not
  • Loading branch information...
robbieaverill committed Jan 12, 2017
1 parent 2a505b0 commit a4bc9f49d10daf302be336da826cabb798a3bac1
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/Security/Security.php
@@ -514,15 +514,17 @@ protected function getResponseController($title)
return $this;
}
// Use sitetree pages to render the security page
$tmpPage = new SiteTree();
// Use the default setting for which Page to use to render the security page
$pageClass = (string) $this->stat('template_main');
$tmpPage = new $pageClass;
$tmpPage->Title = $title;
/** @skipUpgrade */
$tmpPage->URLSegment = 'Security';
// Disable ID-based caching of the log-in page by making it a random number
$tmpPage->ID = -1 * rand(1, 10000000);
$controller = ContentController::create($tmpPage);
$controllerClass = $tmpPage->getControllerName();
$controller = $controllerClass::create($tmpPage);
$controller->setDataModel($this->model);
$controller->doInit();
return $controller;

0 comments on commit a4bc9f4

Please sign in to comment.
You can’t perform that action at this time.