From 6ab13406805b833ee49ccdd9f3113384d82b69be Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 9 Sep 2011 17:36:34 +0200 Subject: [PATCH] BUGFIX Using SiteTree->getSiteConfig() instead of SiteConfig::current_site_config() in SiteTree::batch_permission_check() to avoid cases where multiple variances of SiteConfig need to be considered (e.g. when using the subsites module) (AIR-59) --- code/model/SiteTree.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/model/SiteTree.php b/code/model/SiteTree.php index 068f369a..bd473dc0 100644 --- a/code/model/SiteTree.php +++ b/code/model/SiteTree.php @@ -1123,14 +1123,15 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid if($potentiallyInherited) { // Group $potentiallyInherited by ParentID; we'll look at the permission of all those // parents and then see which ones the user has permission on - $siteConfigPermission = SiteConfig::current_site_config()->{$siteConfigMethod}($memberID); $groupedByParent = array(); foreach($potentiallyInherited as $item) { if($item->ParentID) { if(!isset($groupedByParent[$item->ParentID])) $groupedByParent[$item->ParentID] = array(); $groupedByParent[$item->ParentID][] = $item->ID; } else { - $result[$item->ID] = $siteConfigPermission; + // Might return different site config based on record context, e.g. when subsites module is used + $siteConfig = $item->getSiteConfig(); + $result[$item->ID] = $siteConfig->{$siteConfigMethod}($memberID); } }