Merge pull request #6489 from robbieaverill/bugfix/fallback-layout-for-security

FIX Regression in using template_main to render the Security area
This commit is contained in:
Loz Calver 2017-01-12 09:20:12 +00:00 committed by GitHub
commit b44b8e8209

View File

@ -514,15 +514,17 @@ class Security extends Controller implements TemplateGlobalProvider
return $this; return $this;
} }
// Use sitetree pages to render the security page // Use the default setting for which Page to use to render the security page
$tmpPage = new SiteTree(); $pageClass = (string) $this->stat('template_main');
$tmpPage = new $pageClass;
$tmpPage->Title = $title; $tmpPage->Title = $title;
/** @skipUpgrade */ /** @skipUpgrade */
$tmpPage->URLSegment = 'Security'; $tmpPage->URLSegment = 'Security';
// Disable ID-based caching of the log-in page by making it a random number // Disable ID-based caching of the log-in page by making it a random number
$tmpPage->ID = -1 * rand(1, 10000000); $tmpPage->ID = -1 * rand(1, 10000000);
$controller = ContentController::create($tmpPage); $controllerClass = $tmpPage->getControllerName();
$controller = $controllerClass::create($tmpPage);
$controller->setDataModel($this->model); $controller->setDataModel($this->model);
$controller->doInit(); $controller->doInit();
return $controller; return $controller;