diff --git a/user/selector/lib.php b/user/selector/lib.php index 2a6ad70..fb3dbc4 100644 --- a/user/selector/lib.php +++ b/user/selector/lib.php @@ -437,7 +437,7 @@ abstract class user_selector_base { // If $groupedusers is empty, make a 'no matching users' group. If there is // only one selected user, set a flag to select them if that option is turned on. $select = false; - if (empty($groupedusers)) { + if (empty($groupedusers) && !empty($search)) { $groupedusers = array(get_string('nomatchingusers', '', $search) => array()); } else if ($this->autoselectunique && count($groupedusers) == 1 && count(reset($groupedusers)) == 1) { diff --git a/user/selector/script.js b/user/selector/script.js index dd8bac2..89a226e 100644 --- a/user/selector/script.js +++ b/user/selector/script.js @@ -405,7 +405,7 @@ user_selector.prototype.output_options = function(data) { nogroups = false; } - if (nogroups) { + if (nogroups && (this.lastsearch != "")) { this.output_group(this.insert_search_into_str(this.strnomatchingusers, this.lastsearch), {}, false) }