diff --git a/locallib.php b/locallib.php index d3acd7109464593fc5151fcac80034b4f5fd68e4..36446a46967fd2ea7e99403cec47ae6261385b16 100644 --- a/locallib.php +++ b/locallib.php @@ -736,8 +736,7 @@ function pdfannotator_get_questions($courseid, $context, $questionfilter) { if ($questionfilter == 1) { $sql = $sql . ' AND NOT c.solved = 0 '; } - $sql = $sql . "GROUP BY a.id, p.name, p.usevotes, cm.id, c.id"; - $params = array_merge([$courseid], $inparams); + $sql = $sql . "GROUP BY a.id, p.name, p.usevotes, cm.id, c.id, a.page, a.pdfannotatorid, c.content, c.userid, c.visibility, c.timecreated, c.isdeleted, c.ishidden"; $params = array_merge([$courseid], $inparams); $questions = $DB->get_records_sql($sql, $params); $seehidden = has_capability('mod/pdfannotator:seehiddencomments', $context); @@ -827,7 +826,7 @@ function pdfannotator_get_posts_by_this_user($courseid, $context) { . "JOIN {course_modules} cm ON p.id = cm.instance " . "LEFT JOIN {pdfannotator_votes} v ON c.id = v.commentid " . "WHERE c.userid = ? AND p.course = ? AND cm.id $insql " - . "GROUP BY a.id, p.name, p.usevotes, cm.id, c.id"; + . "GROUP BY a.id, p.name, p.usevotes, cm.id, c.id, c.annotationid, c.content, c.timemodified, c.ishidden, a.page, a.pdfannotatorid"; $params = array_merge([$USER->id, $courseid], $inparams); diff --git a/model/comment.class.php b/model/comment.class.php index 428d7511a1183ff5bdfb7419123679d8fc850f07..e8449015c93a85b5ca14d8e3f7ad9e2a9d27430a 100644 --- a/model/comment.class.php +++ b/model/comment.class.php @@ -145,7 +145,9 @@ class pdfannotator_comment { // Get the ids and text content of all comments attached to this annotation/highlight. $sql = "SELECT c.id, c.content, c.userid, c.visibility, c.isquestion, c.isdeleted, c.ishidden, c.timecreated, c.timemodified, c.modifiedby, c.solved, SUM(vote) AS votes " . "FROM {pdfannotator_comments} c LEFT JOIN {pdfannotator_votes} v" - . " ON c.id=v.commentid WHERE annotationid = ? GROUP BY c.id ORDER BY c.timecreated"; + . " ON c.id=v.commentid WHERE annotationid = ?" + . " GROUP BY c.id, c.content, c.userid, c.visibility, c.isquestion, c.isdeleted, c.ishidden, c.timecreated, c.timemodified, c.modifiedby, c.solved" + . " ORDER BY c.timecreated"; $a = array(); $a[] = $annotationid; $comments = $DB->get_records_sql($sql, $a); // Records taken from table 'comments' as an array of objects. diff --git a/version.php b/version.php index 6375f6a0bcd16d1ebe732269252124451a3e7c5f..be37fbc1b00400f9311482ef555fe1d8fd3b29fa 100644 --- a/version.php +++ b/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'mod_pdfannotator'; // Full name of the plugin (used for diagnostics). -$plugin->version = 2020100800; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2020102300; // The current module version (Date: YYYYMMDDXX). $plugin->release = 'PDF Annotator v1.4 release 4'; $plugin->requires = 2016112900; // Requires this Moodle version.