Permalink
Browse files

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

…ates a warning
  • Loading branch information...
1 parent a2b30aa commit 186fc534013e3620c8dd657945bda8fe6ea3391e @tlock tlock committed with andyjdavis Mar 5, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 message/lib.php
View
@@ -1497,7 +1497,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 186fc53

Please sign in to comment.