MDL-69868 h5pactivity: Prevent breaking $USER when seeing
authorIlya Tregubov <ilya@moodle.com>
Thu, 26 Nov 2020 10:13:55 +0000 (12:13 +0200)
committerIlya Tregubov <ilya@moodle.com>
Thu, 26 Nov 2020 10:39:49 +0000 (12:39 +0200)
                       attempt report.

mod/h5pactivity/classes/local/manager.php

index 840de03..54f94cd 100644 (file)
@@ -387,7 +387,7 @@ class manager {
         if ($this->can_view_all_attempts()) {
             $user = core_user::get_user($userid);
         } else if ($this->can_view_own_attempts()) {
-            $user = $USER;
+            $user = core_user::get_user($USER->id);
             if ($userid && $user->id != $userid) {
                 return null;
             }