Permalink
Browse files

MDL-31869: Searching for users in messaging with multiple roles gener…

…ates a warning
  • Loading branch information...
1 parent ec202dd commit da496c52f8150eaa7a3bb25d614cc1ae9f5bd7d0 @tlock tlock committed with nebgor Mar 5, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 message/lib.php
View
@@ -1510,7 +1510,7 @@ function message_search_users($courseid, $searchtext, $sort='', $exceptions='')
// everyone who has a role assignment in this course or higher
$params = array($USER->id, "%$searchtext%");
- $users = $DB->get_records_sql("SELECT $ufields, mc.id as contactlistid, mc.blocked
+ $users = $DB->get_records_sql("SELECT DISTINCT $ufields, mc.id as contactlistid, mc.blocked
FROM {user} u
JOIN {role_assignments} ra ON ra.userid = u.id
LEFT JOIN {message_contacts} mc

0 comments on commit da496c5

Please sign in to comment.