merged fix for MDL_7112 select distinct on text fields
This commit is contained in:
+1
-1
@@ -25,7 +25,7 @@
|
||||
if (empty($contentlist)) {
|
||||
// We look for text field contents only, and only if the field has
|
||||
// autolink enabled (param1).
|
||||
$sql = 'SELECT DISTINCT(dc.id) AS contentid, ' .
|
||||
$sql = 'SELECT dc.id AS contentid, ' .
|
||||
'dr.id AS recordid, ' .
|
||||
'dc.content AS content, ' .
|
||||
'd.id AS dataid ' .
|
||||
|
||||
+2
-2
@@ -1157,7 +1157,7 @@ function forum_get_readable_forums($userid, $courseid=0) {
|
||||
$selecthidden = '';
|
||||
}
|
||||
|
||||
$selectforums = "SELECT DISTINCT(f.id) AS id,
|
||||
$selectforums = "SELECT f.id AS id,
|
||||
f.name AS name,
|
||||
f.type AS type,
|
||||
f.course AS course,
|
||||
@@ -2907,7 +2907,7 @@ function forum_user_has_posted_discussion($forumid, $userid) {
|
||||
function forum_discussions_user_has_posted_in($forumid, $userid) {
|
||||
global $CFG;
|
||||
|
||||
$haspostedsql = "SELECT DISTINCT(d.id) AS id,
|
||||
$haspostedsql = "SELECT d.id AS id,
|
||||
d.*
|
||||
FROM {$CFG->prefix}forum_posts p,
|
||||
{$CFG->prefix}forum_discussions d
|
||||
|
||||
Reference in New Issue
Block a user