mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
BUGFIX: session error when ErrorPage is viewed in the front
This commit is contained in:
parent
52bd509219
commit
79bedca43b
@ -13,7 +13,17 @@ class ErrorPageSubsite extends DataObjectDecorator {
|
|||||||
$static_filepath = Object::get_static($this->owner->ClassName, 'static_filepath');
|
$static_filepath = Object::get_static($this->owner->ClassName, 'static_filepath');
|
||||||
$subdomainPart = "";
|
$subdomainPart = "";
|
||||||
|
|
||||||
if($subsite = Subsite::currentSubsite(false)) {
|
// when there's a controller get it subsite from session
|
||||||
|
if (Controller::curr()) {
|
||||||
|
$subsite = Subsite::currentSubsite(false);
|
||||||
|
}
|
||||||
|
// since this function is called from Page class before the controller is created, we have to get subsite from domain instead
|
||||||
|
else {
|
||||||
|
$subsiteID = Subsite::getSubsiteIDForDomain();
|
||||||
|
if($subsiteID != 0) $subsite = DataObject::get_by_id("Subsite", $subsiteID);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($subsite) {
|
||||||
$subdomain = $subsite->Subdomain;
|
$subdomain = $subsite->Subdomain;
|
||||||
$subdomainPart = "-{$subdomain}";
|
$subdomainPart = "-{$subdomain}";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user