mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Fixed warning
This commit is contained in:
parent
c572cc4dc6
commit
4729012f4c
1 changed files with 8 additions and 7 deletions
|
@ -1592,9 +1592,9 @@ function role_context_capabilities($roleid, $context, $cap='') {
|
|||
and rc.contextid = c.id $search
|
||||
ORDER BY c.aggregatelevel DESC, rc.capability DESC";
|
||||
|
||||
$records = get_records_sql($SQL);
|
||||
$capabilities = array();
|
||||
|
||||
if ($records = get_records_sql($SQL)) {
|
||||
// We are traversing via reverse order.
|
||||
foreach ($records as $record) {
|
||||
// If not set yet (i.e. inherit or not set at all), or currently we have a prohibit
|
||||
|
@ -1602,6 +1602,7 @@ function role_context_capabilities($roleid, $context, $cap='') {
|
|||
$capabilities[$record->capability] = $record->permission;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $capabilities;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue