BUGFIX: Use live permissions if the stage page has been deleted. (from r91761) (from r96741)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102367 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-12 02:34:21 +00:00
parent 967e218758
commit c672061024

View File

@ -987,7 +987,10 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$combinedStageResult = array();
foreach(array('Stage', 'Live') as $stage) {
$result = array_fill_keys($ids, false);
// Start by filling the array with the pages that actually exist
$table = ($stage=='Stage') ? "SiteTree" : "SiteTree_$stage";
$result = DB::query("SELECT \"ID\",0 FROM \"$table\"
WHERE \"ID\" IN (".implode(", ", $ids).")")->map();
// Get the uninherited permissions
$uninheritedPermissions = Versioned::get_by_stage("SiteTree", $stage, "(\"CanEditType\" = 'LoggedInUsers' OR
@ -1028,6 +1031,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
}
$combinedStageResult = $combinedStageResult + $result;
}
}