diff --git a/code/model/SiteTree.php b/code/model/SiteTree.php index 89d8e0b2..7a48e84b 100644 --- a/code/model/SiteTree.php +++ b/code/model/SiteTree.php @@ -1099,8 +1099,10 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid // Start by filling the array with the pages that actually exist $table = ($stage=='Stage') ? "SiteTree" : "SiteTree_$stage"; - $result = array_fill_keys(DB::query("SELECT \"ID\" FROM \"$table\" - WHERE \"ID\" IN (".implode(", ", $ids).")")->column(), false); + $result = array_fill_keys( + ($ids) ? DB::query("SELECT \"ID\" FROM \"$table\" WHERE \"ID\" IN (".implode(", ", $ids).")")->column() : array(), + false + ); // Get the uninherited permissions $uninheritedPermissions = Versioned::get_by_stage("SiteTree", $stage, "(\"$typeField\" = 'LoggedInUsers' OR