Merge branch '47631-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE

This commit is contained in:
Dan Poltawski
2014-10-16 15:04:14 +01:00
+4 -3
View File
@@ -278,8 +278,9 @@ if (!empty($instanceid) && !empty($roleid)) {
AND anonymous = 0
AND contextlevel = :contextlevel
AND (origin = 'web' OR origin = 'ws')
GROUP BY userid,timecreated) l ON (l.userid = ra.userid)
GROUP BY ra.userid, $usernamefields, u.idnumber";
GROUP BY userid,timecreated) l ON (l.userid = ra.userid)";
// We add this after the WHERE statement that may come below.
$groupbysql = " GROUP BY ra.userid, $usernamefields, u.idnumber";
$params['edulevel'] = core\event\base::LEVEL_PARTICIPATING;
$params['contextlevel'] = CONTEXT_MODULE;
@@ -287,7 +288,7 @@ if (!empty($instanceid) && !empty($roleid)) {
if ($twhere) {
$sql .= ' WHERE '.$twhere; // Initial bar.
}
$sql .= $groupbysql;
if ($table->get_sql_sort()) {
$sql .= ' ORDER BY '.$table->get_sql_sort();
}