Moodle

Groups UI doesn't use role names defined in course settings

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: 1.9, 2.0
  • Component/s: Accessibility, Groups
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE, MOODLE_20_STABLE

Description

1. In course settings, define local names for a role (eg. "Facilitator" for the default "Teacher" role).
2. Create some groups and try to add members
3. Observe that the role name in column of Potential members lists the people with "Facilitator" role under default name "Teacher".

Suggesting the use of the locally defined role names in the interface.

Issue Links

Activity

Hide
Nicolas Martignoni added a comment -

This is reproducible on moodle.org as of today. See for instance course Moodle en français http://moodle.org/course/view.php?id=20

Show
Nicolas Martignoni added a comment - This is reproducible on moodle.org as of today. See for instance course Moodle en français http://moodle.org/course/view.php?id=20
Hide
Martin Dougiamas added a comment -

Aha, Sam, there's a table with course-defined names for roles - you should use those.

eg from admin/roles/assign.php

/// Rename some of the role names if needed
if (isset($coursecontext)) {
if ($aliasnames = get_records('role_names', 'contextid', $coursecontext->id)) {
foreach ($aliasnames as $alias) {
if (isset($assignableroles[$alias->roleid])) { $assignableroles[$alias->roleid] = $alias->text.' ('.$assignableroles[$alias->roleid].')'; }
}
}
}

Show
Martin Dougiamas added a comment - Aha, Sam, there's a table with course-defined names for roles - you should use those. eg from admin/roles/assign.php /// Rename some of the role names if needed if (isset($coursecontext)) { if ($aliasnames = get_records('role_names', 'contextid', $coursecontext->id)) { foreach ($aliasnames as $alias) { if (isset($assignableroles[$alias->roleid])) { $assignableroles[$alias->roleid] = $alias->text.' ('.$assignableroles[$alias->roleid].')'; } } } }
Hide
Martin Dougiamas added a comment -

BTW, I don't think you need to use the (brackets) in this interface ... just the alias name probably

Show
Martin Dougiamas added a comment - BTW, I don't think you need to use the (brackets) in this interface ... just the alias name probably
Hide
Sam Marshall added a comment -

OK, I've added this support (1.9 branch, tagged, and HEAD). Tested trivially by adding an alias in my test course, then removing it again; seemed to work.

Show
Sam Marshall added a comment - OK, I've added this support (1.9 branch, tagged, and HEAD). Tested trivially by adding an alias in my test course, then removing it again; seemed to work.
Hide
Nicolas Martignoni added a comment -

Works now. Thanks for the quick fix. Closing.

Show
Nicolas Martignoni added a comment - Works now. Thanks for the quick fix. Closing.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: