mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Ensure that ModelAsController::init() can trigger redirections. (from r98702)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@99067 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
f5424da34a
commit
530b943dae
@ -45,7 +45,13 @@ class ModelAsController extends Controller implements NestedController {
|
||||
$this->response = new SS_HTTPResponse();
|
||||
|
||||
$this->init();
|
||||
|
||||
|
||||
// If we had a redirection or something, halt processing.
|
||||
if($this->response->isFinished()) {
|
||||
$this->popCurrent();
|
||||
return $this->response;
|
||||
}
|
||||
|
||||
// If the database has not yet been created, redirect to the build page.
|
||||
if(!DB::isActive() || !ClassInfo::hasTable('SiteTree')) {
|
||||
$this->response->redirect(Director::absoluteBaseURL() . 'dev/build?returnURL=' . (isset($_GET['url']) ? urlencode($_GET['url']) : null));
|
||||
|
Loading…
Reference in New Issue
Block a user