From 5f772e4afa97bc663ff85a6c4fcca5b5054a495b Mon Sep 17 00:00:00 2001 From: skodak Date: Wed, 29 Oct 2008 07:16:49 +0000 Subject: [PATCH] MDL-17055 fixed pg regression - removed redundant sorting --- user/index.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/user/index.php b/user/index.php index be7ce7db25..02dea0d707 100644 --- a/user/index.php +++ b/user/index.php @@ -531,10 +531,13 @@ // 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); } -- 2.39.5