mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
BUGFIX: If the site config for a subsite is missing, create it. (from r90262) (from r96327)
This commit is contained in:
parent
a8a2835c51
commit
ce3581c51d
@ -227,7 +227,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…
Reference in New Issue
Block a user