Merge branch 'w40_MDL-35619_m23_otheravatars' of git://github.com/skodak/moodle into...
authorDan Poltawski <dan@moodle.com>
Tue, 2 Oct 2012 02:41:58 +0000 (10:41 +0800)
committerDan Poltawski <dan@moodle.com>
Tue, 2 Oct 2012 02:41:58 +0000 (10:41 +0800)
enrol/locallib.php

index 41b7337..e923c2e 100644 (file)
@@ -766,13 +766,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;