]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-17055 fixed pg regression - removed redundant sorting
authorskodak <skodak>
Wed, 29 Oct 2008 07:16:49 +0000 (07:16 +0000)
committerskodak <skodak>
Wed, 29 Oct 2008 07:16:49 +0000 (07:16 +0000)
user/index.php

index be7ce7db255c53a269608d5370750d7b50ea9ef1..02dea0d707692696110ac9f4b0947c4b42a60d2f 100644 (file)
     // of rows anyway. On a large course it will explode badly...
     //
     if ($mode===MODE_ENROLDETAILS) {
-        $userids = $DB->get_fieldset_sql("SELECT u.id $from $where $wheresearch $sort", $params,
-                                         $table->get_page_start(),  $table->get_page_size());
-        $userids = array_unique($userids);
-
+        if ($context->id != $frontpagectx->id) {
+            $userids = $DB->get_fieldset_sql("SELECT DISTINCT u.id $from $where $wheresearch", $params,
+                                             $table->get_page_start(),  $table->get_page_size());
+        } else {
+            $userids = $DB->get_fieldset_sql("SELECT u.id $from $where $wheresearch", $params,
+                                             $table->get_page_start(),  $table->get_page_size());
+        }
         $userlist_extra = get_participants_extra($userids, $avoidroles, $course, $context);
     }