From 0696bafa737bc81503e2b56aa7787ac80834945a Mon Sep 17 00:00:00 2001 From: tjhunt Date: Wed, 29 Oct 2008 01:33:26 +0000 Subject: [PATCH] participants list: MDL-17055 temporary fix for this regression. Do the DISTINCT bit in PHP rather than SQL. --- user/index.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/user/index.php b/user/index.php index 07133245118..be7ce7db255 100644 --- a/user/index.php +++ b/user/index.php @@ -531,13 +531,10 @@ // of rows anyway. On a large course it will explode badly... // if ($mode===MODE_ENROLDETAILS) { - if ($context->id != $frontpagectx->id) { - $userids = $DB->get_fieldset_sql("SELECT DISTINCT u.id $from $where $wheresearch $sort", $params, - $table->get_page_start(), $table->get_page_size()); - } else { - $userids = $DB->get_fieldset_sql("SELECT u.id $from $where $wheresearch $sort", $params, - $table->get_page_start(), $table->get_page_size()); - } + $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); + $userlist_extra = get_participants_extra($userids, $avoidroles, $course, $context); }