Permalink
Browse files

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

…ates a warning
  • Loading branch information...
1 parent c4d7207 commit 77c5c20554300406199318f1f2b2017d6810e895 @tlock tlock committed with nebgor Mar 5, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 message/lib.php
View
@@ -1508,7 +1508,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 77c5c20

Please sign in to comment.