mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
BUGFIX Consistently resetting Subsite::$disable_subsite_filter to its original state (if the module is installed)
This commit is contained in:
parent
6ab1340680
commit
e26d249d60
@ -1665,7 +1665,10 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
* @param $includeVirtuals Set to false to exlcude virtual pages.
|
||||
*/
|
||||
function DependentPages($includeVirtuals = true) {
|
||||
if(is_callable('Subsite::disable_subsite_filter')) Subsite::disable_subsite_filter(true);
|
||||
if(class_exists('Subsite')) {
|
||||
$origDisableSubsiteFilter = Subsite::$disable_subsite_filter;
|
||||
Subsite::disable_subsite_filter(true);
|
||||
}
|
||||
|
||||
// Content links
|
||||
$items = new ArrayList();
|
||||
@ -1692,7 +1695,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
$items->merge($redirectors);
|
||||
}
|
||||
|
||||
if(is_callable('Subsite::disable_subsite_filter')) Subsite::disable_subsite_filter(false);
|
||||
if(class_exists('Subsite')) Subsite::disable_subsite_filter($origDisableSubsiteFilter);
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user