Skip to content

Commit

Permalink
MDL-27009: Fix role group by statement for statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
aolley authored and Sam Hemelryk committed May 30, 2011
1 parent 9efd421 commit 9b01f68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/statslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@ function stats_get_report_options($courseid,$mode) {
case STATS_MODE_GENERAL:
$reportoptions[STATS_REPORT_ACTIVITY] = get_string('statsreport'.STATS_REPORT_ACTIVITY);
if ($courseid != SITEID && $context = get_context_instance(CONTEXT_COURSE, $courseid)) {
$sql = 'SELECT r.id, r.name FROM {role} r JOIN {stats_daily} s ON s.roleid = r.id WHERE s.courseid = :courseid GROUP BY s.roleid';
$sql = 'SELECT r.id, r.name FROM {role} r JOIN {stats_daily} s ON s.roleid = r.id WHERE s.courseid = :courseid GROUP BY r.id, r.name';
if ($roles = $DB->get_records_sql($sql, array('courseid' => $courseid))) {
foreach ($roles as $role) {
$reportoptions[STATS_REPORT_ACTIVITYBYROLE.$role->id] = get_string('statsreport'.STATS_REPORT_ACTIVITYBYROLE). ' '.$role->name;
Expand Down

0 comments on commit 9b01f68

Please sign in to comment.