Hi,
I'm having a couple of issues with the Subsites Module, and i feel like they might be related somehow.
Running 2.4.5 and the latest subsites trunk (r116127) I've set up a main site and one subsite.
Following this tutorial I created a CustomSiteConfig Decorator to store a HTML Footer and registered the Decorator in my mysite/_config.php
<?php
class CustomSiteConfig extends DataObjectDecorator {
function extraStatics() {
return array(
'db' => array(
'Footer' => 'HTMLText'
)
);
}
public function updateCMSFields(FieldSet &$fields) {
// add footer field
$fields->addFieldToTab("Root.Main", new HtmlEditorField("Footer", "Footer", 10));
}
}
And in mysite/_config.php
// add CustomSiteConfig
DataObject::add_extension('SiteConfig', 'CustomSiteConfig');
Then, following the instructions here http://open.silverstripe.org/ticket/5997 I managed to get Subsites to save and load the correct SiteConfigs when using the Dropdown menu in the CMS Header area.
However, if I click on the root icon (the one with the little globe) in my subsite's SiteTree, the main Siteconfig is being loaded, with the SiteTree still showing my Subsite's page structure. If I edit values and hit save, the main Siteconfig gets overwritten, but I'm still seeing my Subsite's SiteTree.
I couldn't find any related tickets in the bugtracker, is this a known issue or is anybody else experiencing the same problem?
I think Subsites in connection with SiteConfig would be a fantastic extension to Silverstripe and i'd love to use it in an upcoming project, so I'm tipping my hat to the developers of these little gems.
Any help would be greatly appreciated. Thanks in advance,
Andi
------------------- EDIT: --------------------
The same issue occurs when I add a DataObjectManager to my CustomSiteConfig Decorator
function extraStatics() {
return array(
...
'has_many' => array(
'SlideshowImages' => 'SlideshowImage'
)
);
}
public function updateCMSFields(FieldSet &$fields) {
...
// add slideshow manager
$manager = new DataObjectManager(
$this->owner,
'SlideshowImages',
'SlideshowImage',
array('Title' => 'Title'),
'getCMSFields_forPopup'
);
$manager->setSourceID($this->owner->ID);
$fields->addFieldToTab("Root.Images", $manager);
}
Everything loads up correctly when navigating to SiteConfig via the Subsites Dropdown, but if I add new images to my subsite and close the DOM Popup, the main SiteConfig gets loaded, with the added DataObjects linking up to the main site's SiteConfig.