mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Make virtual page broken link detection work across subsites. (from r91311) (from r96740)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102366 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
848b7805e2
commit
967e218758
@ -1375,7 +1375,14 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
|
|
||||||
// Also write all VPs pointing here
|
// Also write all VPs pointing here
|
||||||
$suffix = Versioned::current_stage() == 'Live' ? '_Live' : '';
|
$suffix = Versioned::current_stage() == 'Live' ? '_Live' : '';
|
||||||
|
|
||||||
|
// 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}");
|
$virtualPages = DataObject::get('VirtualPage', "SiteTree$suffix.ID = SiteTree$suffix.ID AND CopyContentFromID = {$this->ID}");
|
||||||
|
}
|
||||||
|
|
||||||
if($virtualPages) foreach($virtualPages as $page) {
|
if($virtualPages) foreach($virtualPages as $page) {
|
||||||
// $page->write() calls syncLinkTracking, which does all the hard work for us.
|
// $page->write() calls syncLinkTracking, which does all the hard work for us.
|
||||||
$page->write();
|
$page->write();
|
||||||
|
Loading…
Reference in New Issue
Block a user