mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-63665 mod_choice: no exception when course_modules doesn't exist
This issue is a part of the MDL-62560 Epic.
This commit is contained in:
parent
b96446f3af
commit
8839feb90e
@ -244,7 +244,10 @@ class provider implements
|
||||
if (!$context instanceof \context_module) {
|
||||
continue;
|
||||
}
|
||||
$instanceid = $DB->get_field('course_modules', 'instance', ['id' => $context->instanceid], MUST_EXIST);
|
||||
$instanceid = $DB->get_field('course_modules', 'instance', ['id' => $context->instanceid]);
|
||||
if (!$instanceid) {
|
||||
continue;
|
||||
}
|
||||
$DB->delete_records('choice_answers', ['choiceid' => $instanceid, 'userid' => $userid]);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user