MDL-82499 question: Fail if questionid does not exist.
This commit is contained in:
+1
-1
@@ -1465,7 +1465,7 @@ function question_has_capability_on($questionorid, $cap, $notused = -1): bool {
|
||||
WHERE q.id = :id';
|
||||
|
||||
// Well, at least we tried. Seems that we really have to read from DB.
|
||||
$question = $DB->get_record_sql($sql, ['id' => $questionid]);
|
||||
$question = $DB->get_record_sql($sql, ['id' => $questionid], MUST_EXIST);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user