mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
fixed error in fetch_context_capabilities() when no local capabilities defined in context
This commit is contained in:
parent
adbffcb9fe
commit
16e2e2f394
@ -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");
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user