Moodle

Moodle Networking 1.9 - Overview report and user report does not work

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9.2
  • Fix Version/s: 1.9.5
  • Component/s: Gradebook, MNet
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

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?

Activity

Hide
Lori Bakken added a comment -

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.

Show
Lori Bakken added a comment - 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.
Hide
Petr Škoda (skodak) added a comment -

fixed, that function was not needed there at all, in fact it was a bug
thanks for the report

Show
Petr Škoda (skodak) added a comment - fixed, that function was not needed there at all, in fact it was a bug thanks for the report

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: