mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
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:
parent
0760673568
commit
fe25268274
@ -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));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user