MDL-45933 Assign: Prevent fatal error when there are no users in the grading table

This commit is contained in:
Damyon Wiese 2014-06-18 15:17:02 +08:00
parent 33efee99ff
commit 1165b7ded7

View File

@ -4984,6 +4984,10 @@ class assign {
$users[$userid] = $record;
}
if (empty($users)) {
return get_string('nousersselected', 'assign');
}
list($userids, $params) = $DB->get_in_or_equal(array_keys($users), SQL_PARAMS_NAMED);
$params['assignid1'] = $this->get_instance()->id;
$params['assignid2'] = $this->get_instance()->id;