mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
BUGFIX Don't check for Controller::curr() in ErrorPageSubsite, this causes a user_error when none is available (e.g. when running tests through "phpunit" executable)
This commit is contained in:
parent
5039e2ebd3
commit
a178d7c4c3
@ -14,11 +14,12 @@ class ErrorPageSubsite extends DataObjectDecorator {
|
||||
$subdomainPart = "";
|
||||
|
||||
// when there's a controller get it subsite from session
|
||||
if (Controller::curr()) $subsite = Subsite::currentSubsite(false);
|
||||
if (Controller::has_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);
|
||||
else $subsite = null;
|
||||
}
|
||||
|
||||
if($subsite) {
|
||||
|
Loading…
Reference in New Issue
Block a user