mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX Don't fail SiteTree::batch_permission_check() is no published pages exist
This commit is contained in:
parent
e26d249d60
commit
987eedf9ba
@ -1099,8 +1099,10 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
// Start by filling the array with the pages that actually exist
|
// Start by filling the array with the pages that actually exist
|
||||||
$table = ($stage=='Stage') ? "SiteTree" : "SiteTree_$stage";
|
$table = ($stage=='Stage') ? "SiteTree" : "SiteTree_$stage";
|
||||||
|
|
||||||
$result = array_fill_keys(DB::query("SELECT \"ID\" FROM \"$table\"
|
$result = array_fill_keys(
|
||||||
WHERE \"ID\" IN (".implode(", ", $ids).")")->column(), false);
|
($ids) ? DB::query("SELECT \"ID\" FROM \"$table\" WHERE \"ID\" IN (".implode(", ", $ids).")")->column() : array(),
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
// Get the uninherited permissions
|
// Get the uninherited permissions
|
||||||
$uninheritedPermissions = Versioned::get_by_stage("SiteTree", $stage, "(\"$typeField\" = 'LoggedInUsers' OR
|
$uninheritedPermissions = Versioned::get_by_stage("SiteTree", $stage, "(\"$typeField\" = 'LoggedInUsers' OR
|
||||||
|
Loading…
Reference in New Issue
Block a user