Details
Description
We're running moodle networking and when I jump into a course within moodle networking and click on grades, the grades show fine.
If I click on user report or overview report I get incorrect userid.
Can this be fixed easily?
We're running moodle networking and when I jump into a course within moodle networking and click on grades, the grades show fine.
If I click on user report or overview report I get incorrect userid.
Can this be fixed easily?
Ok, I fixed it:
Here's my solution:
The problem lies when the user report and overview report calls the get_complete_user_data function.
Since mnet is being used it was using the mnet hostid of 1. But since this is a remote instance, the remote id for my instance was 4. So it couldn't
find the user in the user table because the constraints were incorrect.
So I added: (In both index.php in /grade/report/user and /grade/report/overview
after line 31 : $userid = optional_param('userid', $USER->id, PARAM_INT);
$hostid = $USER->mnethostid; <- not sure if this is the right format, but it works.
Then I modified:
Line 47
if (!get_complete_user_data('id', $userid)){ ...
to
if (!get_complete_user_data('id', $userid, $hostid)){ ...
and this solved my issues.