BUGFIX: Removed unnecessary SiteTreeSubsites event handlers, since SiteTree is now sufficiently subsite aware. This provided a significant performance increase. (by sminnee, merged from r103169)

This commit is contained in:
Sam Minnee 2011-09-22 17:48:23 +02:00 committed by Ingo Schommer
parent 0760673568
commit fe25268274

View File

@ -87,20 +87,6 @@ class SiteTreeSubsites extends SiteTreeDecorator {
parent::onBeforeWrite(); parent::onBeforeWrite();
} }
function onAfterPublish(&$original) {
// Publish any subsite virtual pages that might need publishing
$oldState = Subsite::$disable_subsite_filter;
Subsite::$disable_subsite_filter = true;
$linkedPages = DataObject::get("SubsitesVirtualPage", "\"CopyContentFromID\" = {$this->owner->ID}");
if($linkedPages) foreach($linkedPages as $page) {
$page->copyFrom($page->CopyContentFrom());
if($page->ExistsOnLive) $page->doPublish();
}
Subsite::$disable_subsite_filter = $oldState;
}
function updateCMSFields(&$fields) { function updateCMSFields(&$fields) {
if($this->owner->MasterPageID) $fields->insertFirst(new HeaderField('This page\'s content is copied from a master page: ' . $this->owner->MasterPage()->Title, 2)); if($this->owner->MasterPageID) $fields->insertFirst(new HeaderField('This page\'s content is copied from a master page: ' . $this->owner->MasterPage()->Title, 2));