BUGFIX: If the site config for a subsite is missing, create it. (from r90262)

This commit is contained in:
Tom Rix 2010-03-01 21:39:23 +00:00
parent 8049ead131
commit 6f8193a172

View File

@ -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;
}
/**