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

This commit is contained in:
Tom Rix 2010-03-01 22:28:50 +00:00
parent a8a2835c51
commit ce3581c51d

View File

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