mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
MINOR Removed SiteTreeSubsites->onAfterWrite(), same behaviour already implemented in SiteTree (copying content from VirtualPage records, including its subclass SubsitesVirtualPage) (AIR-52)
This commit is contained in:
parent
069c5ada3c
commit
bb486548d6
@ -112,20 +112,6 @@ class SiteTreeSubsites extends SiteTreeDecorator {
|
||||
parent::onBeforeWrite();
|
||||
}
|
||||
|
||||
function onAfterWrite(&$original) {
|
||||
// Update any subsite virtual pages that might need updating
|
||||
$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());
|
||||
$page->write();
|
||||
}
|
||||
|
||||
Subsite::$disable_subsite_filter = $oldState;
|
||||
}
|
||||
|
||||
function onAfterPublish(&$original) {
|
||||
// Publish any subsite virtual pages that might need publishing
|
||||
$oldState = Subsite::$disable_subsite_filter;
|
||||
|
Loading…
Reference in New Issue
Block a user