MDL-76719 mod_assign: don't try to load user if there are none.

This commit is contained in:
Paul Holden 2023-12-01 13:00:25 +00:00
parent abba174fe1
commit 44199688e5
No known key found for this signature in database
GPG Key ID: A81A96D6045F6164
3 changed files with 5 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -336,8 +336,9 @@ define(['jquery', 'core/notification', 'core/str', 'core/form-autocomplete',
} else {
select.attr('data-selected', userid);
if (!isNaN(useridnumber) && useridnumber > 0) {
$(document).trigger('user-changed', userid);
// If we have some filtered users, and userid is specified, then trigger change.
if (this._filteredUsers.length > 0 && !isNaN(useridnumber) && useridnumber > 0) {
$(document).trigger('user-changed', useridnumber);
}
}
};