MDL-56810 unoconv: task fails if user removed

If the user is removed from a course after a submission has been made,
the task will crash and never continue.  This removes submissions from
the cron task if the user isn't enrolled in the course.
This commit is contained in:
Matt Davidson
2016-12-12 08:22:51 -05:00
parent 5ef81f2b0b
commit 6be2b79b9c
@@ -92,14 +92,18 @@ class convert_submissions extends scheduled_task {
mtrace('Convert ' . count($users) . ' submission attempt(s) for assignment ' . $assignmentid);
foreach ($users as $userid) {
document_services::get_page_images_for_attempt($assignment,
$userid,
$attemptnumber,
true);
document_services::get_page_images_for_attempt($assignment,
$userid,
$attemptnumber,
false);
try {
document_services::get_page_images_for_attempt($assignment,
$userid,
$attemptnumber,
true);
document_services::get_page_images_for_attempt($assignment,
$userid,
$attemptnumber,
false);
} catch (\moodle_exception $e) {
mtrace('Conversion failed with error:' . $e->errorcode);
}
}
$DB->delete_records('assignfeedback_editpdf_queue', array('id' => $record->id));