Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MINOR virtual pages are now marked as broken if their pointer page is…

… deleted (from r90996) (from r96737)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102363 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit 4a3986a28c75a2e0c854ee7fdb568140de711c86 1 parent 43fb34a
@chillu chillu authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 core/model/SiteTree.php
View
7 core/model/SiteTree.php
@@ -1373,6 +1373,13 @@ function onAfterDelete() {
$page->write();
}
+ // Also write all VPs pointing here
+ $suffix = Versioned::current_stage() == 'Live' ? '_Live' : '';
+ foreach(DataObject::get('VirtualPage', "SiteTree$suffix.ID = SiteTree$suffix.ID AND CopyContentFromID = {$this->ID}") as $page) {
+ // $page->write() calls syncLinkTracking, which does all the hard work for us.
+ $page->write();
+ }
+
parent::onAfterDelete();
}
Please sign in to comment.
Something went wrong with that request. Please try again.