-
Bug
-
Resolution: Fixed
-
Minor
-
3.0.6, 3.1.2, 3.6, 3.7
-
MOODLE_30_STABLE, MOODLE_31_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
-
MOODLE_36_STABLE, MOODLE_37_STABLE
-
MDL-55997-master -
Since MDL-51913, when there is a duplicate row returned by the stats tables in report/stats/user.php, the resulting table will have a row for each of the duplicate entries.
The list of stats returned by the database needs to be filtered to only have one entry per 'timeend' entry.
This was previously done by stats_fix_zeros which would use the array key to do that, but now that the array key is the "id" field, it no longer does.
Easiest solution is probably to build the $stats array in stats_fix_zeros by using $s->timeend rather than the array key $statid. But that may have consequences for other reports that use stats_fix_zeros.
The alternative that fixes this specific regression without affecting other things is to filter the results right after performing the get_records_sql call.