]> git.mjollnir.org Git - moodle.git/commitdiff
merged fix for MDL_7112 select distinct on text fields
authortoyomoyo <toyomoyo>
Thu, 2 Nov 2006 02:10:53 +0000 (02:10 +0000)
committertoyomoyo <toyomoyo>
Thu, 2 Nov 2006 02:10:53 +0000 (02:10 +0000)
mod/data/filter.php
mod/forum/lib.php

index 2030eb70b8d2dcfb6acc2c4bd35a79bbe9772ff2..d0e9cc6c4d9b6d3f98e29eff79f7f69ebfbd3068 100644 (file)
@@ -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 ' .
index eddef523484caa0e460eb49c553fe62c32b3fb5f..6d9097c58a82a2ebcda2517596873f442fee23af 100644 (file)
@@ -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