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:36 +08:00
parent 8791525d88
commit 5e63c8e57e
+4
View File
@@ -4982,6 +4982,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;