BUG: Subsite save SiteConfig overwrites MainSite SiteConfig (Issue #15)

Implemented the fix mentioned in the bug ticket within the subsites
settings extension (use current subsite id)
This commit is contained in:
Naomi Guyer 2013-05-24 16:26:57 +12:00
parent 7965c86120
commit 3ad7ddcfce

View File

@ -3,7 +3,7 @@
/** /**
* Extension for the SiteConfig object to add subsites support * Extension for the SiteConfig object to add subsites support
*/ */
class SiteConfigSubsites extends DataExtension { class SiteConfigSubsites extends DataExtension {
private static $has_one = array( private static $has_one = array(
'Subsite' => 'Subsite', // The subsite that this page belongs to 'Subsite' => 'Subsite', // The subsite that this page belongs to
@ -38,4 +38,8 @@ class SiteConfigSubsites extends DataExtension {
function cacheKeyComponent() { function cacheKeyComponent() {
return 'subsite-'.Subsite::currentSubsiteID(); return 'subsite-'.Subsite::currentSubsiteID();
} }
function updateCMSFields(FieldList $fields) {
$fields->push(new HiddenField('SubsiteID','SubsiteID', Subsite::currentSubsiteID()));
}
} }