Index: view.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/data/view.php,v
retrieving revision 1.56.2.8
diff -u -r1.56.2.8 view.php
--- view.php	31 Mar 2008 06:18:11 -0000	1.56.2.8
+++ view.php	21 Apr 2008 18:36:47 -0000
@@ -300,7 +300,7 @@
         $sortcontent = $sortfield->get_sort_field();
         $sortcontentfull = $sortfield->get_sort_sql('c.'.$sortcontent);
 
-        $what = ' DISTINCT r.id, r.approved, r.userid, u.firstname, u.lastname, c.'.$sortcontent.', '.$sortcontentfull.' AS _order ';
+        $what = ' r.id, r.approved, r.userid, u.firstname, u.lastname, c.'.$sortcontent.', '.$sortcontentfull.' AS _order ';
         $count = ' COUNT(DISTINCT c.recordid) ';
         $tables = $CFG->prefix.'data_content c,'.$CFG->prefix.'data_records r,'.$CFG->prefix.'data_content c1, '.$CFG->prefix.'user u ';
         $where =  'WHERE c.recordid = r.id
@@ -320,7 +320,7 @@
         }
 
     } else if ($search) {
-        $what = ' DISTINCT r.id, r.approved, r.userid, u.firstname, u.lastname ';
+        $what = ' r.id, r.approved, r.userid, u.firstname, u.lastname ';
         $count = ' COUNT(DISTINCT c.recordid) ';
         $tables = $CFG->prefix.'data_content c,'.$CFG->prefix.'data_records r, '.$CFG->prefix.'user u ';
         $where =  'WHERE c.recordid = r.id
@@ -334,7 +334,7 @@
         $searchselect = ' AND (c.content ' . sql_ilike() . " '%$search%') "; //Be case-insensitive
 
     } else {
-        $what = ' DISTINCT r.id, r.approved, r.timecreated, r.userid, u.firstname, u.lastname ';
+        $what = ' r.id, r.approved, r.timecreated, r.userid, u.firstname, u.lastname ';
         $count = ' COUNT(r.id) ';
         $tables = $CFG->prefix.'data_records r, '.$CFG->prefix.'user u ';
         $where =  'WHERE r.dataid = '.$data->id. ' AND r.userid = u.id ';
