From e66827464a491536f24c8671ca67d5351f31bd60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Mon, 1 Oct 2012 09:51:12 +0200 Subject: [PATCH] MDL-35619 fix invalid avatars on other users page --- enrol/locallib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/enrol/locallib.php b/enrol/locallib.php index 596320a7ee6..bca932a8070 100644 --- a/enrol/locallib.php +++ b/enrol/locallib.php @@ -787,13 +787,15 @@ class course_enrolment_manager { $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;