$users = array();
foreach ($userroles as $userrole) {
+ $contextid = $userrole->contextid;
+ unset($userrole->contextid); // This would collide with user avatar.
if (!array_key_exists($userrole->id, $users)) {
$users[$userrole->id] = $this->prepare_user_for_display($userrole, $extrafields, $now);
}
$a = new stdClass;
$a->role = $roles[$userrole->roleid]->localname;
$changeable = ($userrole->component == '');
- if ($userrole->contextid == $this->context->id) {
+ if ($contextid == $this->context->id) {
$roletext = get_string('rolefromthiscourse', 'enrol', $a);
} else {
$changeable = false;