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
This commit is contained in:
Ingo Schommer 2010-04-12 02:32:51 +00:00
parent 43fb34a748
commit 4a3986a28c

View File

@ -1373,6 +1373,13 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$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();
}