Skip to content

Commit

Permalink
MDL-31869: Searching for users in messaging with multiple roles gener…
Browse files Browse the repository at this point in the history
…ates a warning
  • Loading branch information
tlock authored and Aparup Banerjee committed Mar 27, 2012
1 parent c4d7207 commit 77c5c20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion message/lib.php
Expand Up @@ -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
Expand Down

0 comments on commit 77c5c20

Please sign in to comment.