BUGFIX Consistently resetting Subsite::$disable_subsite_filter to its original state (if the module is installed)

This commit is contained in:
Ingo Schommer 2011-10-07 09:38:11 +02:00
parent 6ab1340680
commit e26d249d60

View File

@ -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;
}