mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX: Make virtual page broken link detection work across subsites. (from r91311)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96740 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
337019a4c9
commit
26244b743d
@ -1365,7 +1365,14 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
|
||||
// Also write all VPs pointing here
|
||||
$suffix = Versioned::current_stage() == 'Live' ? '_Live' : '';
|
||||
$virtualPages = DataObject::get('VirtualPage', "SiteTree$suffix.ID = SiteTree$suffix.ID AND CopyContentFromID = {$this->ID}");
|
||||
|
||||
// This coupling to the subsites module is frustrating, but difficult to avoid.
|
||||
if(class_exists('Subsite')) {
|
||||
$virtualPages = Subsite::get_from_all_subsites('VirtualPage', "SiteTree$suffix.ID = SiteTree$suffix.ID AND CopyContentFromID = {$this->ID}");
|
||||
} else {
|
||||
$virtualPages = DataObject::get('VirtualPage', "SiteTree$suffix.ID = SiteTree$suffix.ID AND CopyContentFromID = {$this->ID}");
|
||||
}
|
||||
|
||||
if($virtualPages) foreach($virtualPages as $page) {
|
||||
// $page->write() calls syncLinkTracking, which does all the hard work for us.
|
||||
$page->write();
|
||||
|
Loading…
x
Reference in New Issue
Block a user