Commit 917923c8 authored by Damyon Wiese's avatar Damyon Wiese

Merge branch 'MDL-60043' of git://

parents 5ec2ce20 aceb84ad
......@@ -319,8 +319,7 @@ function get_role_definitions_uncached(array $roleids) {
$sql = "SELECT ctx.path, rc.roleid, rc.capability, rc.permission
FROM {role_capabilities} rc
JOIN {context} ctx ON rc.contextid =
WHERE rc.roleid $sql
ORDER BY ctx.path, rc.roleid, rc.capability";
WHERE rc.roleid $sql";
$rs = $DB->get_recordset_sql($sql, $params);
foreach ($rs as $rd) {
......@@ -334,6 +333,15 @@ function get_role_definitions_uncached(array $roleids) {
// Sometimes (e.g. get_user_capability_course_helper::get_capability_info_at_each_context)
// we process role definitinons in a way that requires we see parent contexts
// before child contexts. This sort ensures that works (and is faster than
// sorting in the SQL query).
foreach ($rdefs as $roleid => $rdef) {
return $rdefs;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment