Skip to content

Commit

Permalink
BUGFIX #3970: Make virtual page editing work.
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75869 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
Sam Minnee committed Feb 2, 2011
1 parent 2574968 commit f880f4e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/model/SiteTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,13 @@ function onAfterWrite() {
// Need to flush cache to avoid outdated versionnumber references
$this->flushCache();

// Update any virtual pages that might need updating
$linkedPages = DataObject::get("VirtualPage", "CopyContentFromID = $this->ID");
if($linkedPages) foreach($linkedPages as $page) {
$page->copyFrom($page->CopyContentFrom());
$page->write();
}

parent::onAfterWrite();
}

Expand Down

0 comments on commit f880f4e

Please sign in to comment.