Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use role sortorder when getting role lists

  • Loading branch information...
commit 988ad08450a880331da7dfe6f1825294370bbcc6 1 parent 0c88b9a
moodler authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/accesslib.php
4 lib/accesslib.php
View
@@ -2427,7 +2427,7 @@ function get_assignable_roles ($context) {
$options = array();
- if ($roles = get_records('role')) {
+ if ($roles = get_records('role', '', '', 'sortorder ASC')) {
foreach ($roles as $role) {
if (user_can_assign($context, $role->id)) {
$options[$role->id] = $role->name;
@@ -2446,7 +2446,7 @@ function get_overridable_roles ($context) {
$options = array();
- if ($roles = get_records('role')) {
+ if ($roles = get_records('role', '', '', 'sortorder ASC')) {
foreach ($roles as $role) {
if (user_can_override($context, $role->id)) {
$options[$role->id] = $role->name;
Please sign in to comment.
Something went wrong with that request. Please try again.