-
Type:
Bug
-
Status: Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 2.1.1, 2.2
-
Fix Version/s: 2.1.2
-
Labels:
-
Database:PostgreSQL
-
Testing Instructions:
-
Affected Branches:MOODLE_21_STABLE, MOODLE_22_STABLE
-
Fixed Branches:MOODLE_21_STABLE
-
Pull from Repository:
-
Pull Master Branch:
MDL-27845_rating_aggregation -
Pull Master Diff URL:
I got this error when access news forum: Debug info:
ERROR: column "ur.rating" must appear in the GROUP BY clause or be used in an aggregate function
|
LINE 3: ... ur.id, ur.userid, ur.scaleid, ur.rating ...
|
^
|
SELECT r.itemid, r.component, r.ratingarea, r.contextid,
|
AVG(r.rating) AS aggrrating, COUNT(r.rating) AS numratings,
|
ur.id, ur.userid, ur.scaleid, ur.rating AS usersrating
|
FROM mdl_rating r
|
LEFT JOIN mdl_rating ur ON ur.contextid = r.contextid AND
|
ur.itemid = r.itemid AND
|
ur.component = r.component AND
|
ur.ratingarea = r.ratingarea AND
|
ur.userid = $1
|
WHERE r.contextid = $2 AND
|
r.itemid = $3 AND
|
r.component = $4 AND
|
r.ratingarea = $5
|
GROUP BY r.itemid, r.component, r.ratingarea, r.contextid, ur.id, ur.userid, ur.scaleid
|
ORDER BY r.itemid
|
[array (
|
0 => '2',
|
1 => '28',
|
2 => '31',
|
3 => 'mod_forum',
|
4 => 'post',
|
)]
|