-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
2.9.3, 3.0, 3.0.1, 3.0.2
-
None
-
2016012600
-
MOODLE_29_STABLE, MOODLE_30_STABLE
I have uncovered a number of postgres sql specific errors which prevent a number of forum functions to work as designed.
/mod/hsfourum/renderer.php
Line apprx 307
Fails:
$replyusers = $DB->get_records_sql("SELECT DISTINCT $fields FROM
Postgres requires the order by column to be part of the fields in the select
Works:
$replyusers = $DB->get_records_sql("SELECT DISTINCT $fields, hp.modified FROM{hsuforum_posts}
hp JOIN
{user}u ON hp.userid = u.id WHERE hp.discussion = ? AND hp.privatereply = 0 ORDER BY hp.modified DESC", array($discussion->id));
Also,
lib/table/posters.php
Apprx Line 54 sql begins, must add u.id to group by apprx line 61 in order for sql to run in postgres.
Similar error group by clause.