diff --git a/lib/accesslib.php b/lib/accesslib.php index d4440397d50..2e6ede2b58e 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -1946,7 +1946,9 @@ function fetch_context_capabilities($context) { return false; } - $records = get_records_sql($SQL.' '.$sort); + if (!$records = get_records_sql($SQL.' '.$sort)) { + $records = array(); + } $contextindependentcaps = fetch_context_independent_capabilities(); $records = array_merge($records, $contextindependentcaps); @@ -2750,4 +2752,4 @@ function get_users_from_role_on_context($role, $context) { AND roleid = $role->id"); } -?> +?> \ No newline at end of file