Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-27009: Fix role group by statement for statistics

  • Loading branch information...
commit 9b01f6859718208229ad9b964d39578b3fba0bce 1 parent 9efd421
Adam Olley authored March 29, 2011 samhemelryk committed May 30, 2011

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  lib/statslib.php
2  lib/statslib.php
@@ -1333,7 +1333,7 @@ function stats_get_report_options($courseid,$mode) {
1333 1333
     case STATS_MODE_GENERAL:
1334 1334
         $reportoptions[STATS_REPORT_ACTIVITY] = get_string('statsreport'.STATS_REPORT_ACTIVITY);
1335 1335
         if ($courseid != SITEID && $context = get_context_instance(CONTEXT_COURSE, $courseid)) {
1336  
-            $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';
  1336
+            $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';
1337 1337
             if ($roles = $DB->get_records_sql($sql, array('courseid' => $courseid))) {
1338 1338
                 foreach ($roles as $role) {
1339 1339
                     $reportoptions[STATS_REPORT_ACTIVITYBYROLE.$role->id] = get_string('statsreport'.STATS_REPORT_ACTIVITYBYROLE). ' '.$role->name;

0 notes on commit 9b01f68

Please sign in to comment.
Something went wrong with that request. Please try again.