mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 09:05:55 +00:00
BUGFIX: If the site config for a subsite is missing, create it. (from r90262)
This commit is contained in:
parent
8049ead131
commit
6f8193a172
@ -225,7 +225,15 @@ class SiteTreeSubsites extends SiteTreeDecorator {
|
||||
}
|
||||
|
||||
function alternateSiteConfig() {
|
||||
return DataObject::get_one('SiteConfig', 'SubsiteID = ' . $this->owner->SubsiteID);
|
||||
$sc = DataObject::get_one('SiteConfig', 'SubsiteID = ' . $this->owner->SubsiteID);
|
||||
if(!$sc) {
|
||||
$sc = new SiteConfig();
|
||||
$sc->SubsiteID = $this->owner->SubsiteID;
|
||||
$sc->Title = 'Your Site Name';
|
||||
$sc->Tagline = 'your tagline here';
|
||||
$sc->write();
|
||||
}
|
||||
return $sc;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user