-
Bug
-
Resolution: Fixed
-
Critical
-
2.0.2
-
PostgreSQL
-
MOODLE_20_STABLE
-
MOODLE_20_STABLE
-
This may just be an issue with postgres, but when trying to view statistics for any course, after selecting the course from the drop down and clicking 'view', you get:
[Tue Mar 29 12:06:04 2011] [error] [client 131.172.34.113] Default exception handler: Error reading from database Debug: ERROR: column "r.id" must appear in the GROUP BY clause or be used in an aggregate function at character 8\nSELECT r.id, r.name FROM mdl_role r JOIN mdl_stats_daily s ON s.roleid = r.id WHERE s.courseid = $1 GROUP BY s.roleid\n[array (\n 0 => '35',\n)]\n* line 391 of /lib/dml/moodle_database.php: dml_read_exception thrown\n* line 232 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()\n* line 672 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()\n* line 1337 of /lib/statslib.php: call to pgsql_native_moodle_database->get_records_sql()\n* line 18 of /course/report/stats/report.php: call to stats_get_report_options()\n* line 65 of /course/report/stats/index.php: call to require()\n, referer: https://lmsdev.latrobe.edu.au/course/report/stats/index.php
Basically, an sql query introduced in MDL-25822 uses 'group by' but isn't grouping/aggregating everything it's selecting.
I've put a fix for this on github as follows:
https://github.com/aolley/moodle/commit/0960f2f417b4e95fe9ae46bad103c114c57dc9cc
- has a non-specific relationship to
-
MDL-25822 Statistics not working for any course but front page
-
- Closed
-