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:
Ingo Schommer 2010-09-21 21:10:29 +00:00
parent 5039e2ebd3
commit a178d7c4c3

View File

@ -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) {