-
Bug
-
Resolution: Fixed
-
Minor
-
3.3.1, 3.3.3, 3.4.3, 3.5, 3.5.1
-
MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
-
MOODLE_34_STABLE, MOODLE_35_STABLE
-
MDL-60014-master-catcherror-nopermission-annotatepdfcron -
I've encountered a recurrence of resolved bug MDL-56810 on Moodle 3.3.1.
Steps to reproduce:
- Create a course, add an assignment and enrol a user as a student
- As the student, submit a file to the assignment
- Unenrol the student from the course.
- Run the convert annotation task (you don't need any PDF converter enabled to run this)
- You will have the following error :
Execute scheduled task: Préparer les travaux remis pour annotation (assignfeedback_editpdf\task\convert_submissions)
|
... started 08:40:29. Current memory use 19.6MB. |
Convert 1 submission attempt(s) for assignment 7888 |
... used 14 dbqueries |
... used 0.0099310874938965 seconds |
Scheduled task failed: Préparer les travaux remis pour annotation (assignfeedback_editpdf\task\convert_submissions),error/nopermission
|
Backtrace:
|
* line 254 of /mod/assign/feedback/editpdf/classes/document_services.php: call to print_error() |
* line 302 of /mod/assign/feedback/editpdf/classes/document_services.php: call to assignfeedback_editpdf\document_services::get_combined_document_for_attempt() |
* line 97 of /mod/assign/feedback/editpdf/classes/task/convert_submissions.php: call to assignfeedback_editpdf\document_services::get_combined_pdf_for_attempt() |
* line 141 of /lib/cronlib.php: call to assignfeedback_editpdf\task\convert_submissions->execute() |
* line 249 of /lib/cronlib.php: call to cron_run_inner_scheduled_task() |
* line 91 of /admin/tool/task/schedule_task.php: call to cron_run_single_task() |
Apparently, at some time after the fix to MDL-56810, a call to get_combined_pdf_for_attempt was added at line 97 in convert_submissions.php. This method calls get_combined_pdf_for_attempt, which then calls get_combined_document_for_attempt and list_compatible_submission_files_for_attempt. Both methods check if the user can access the submission, and raise an error if not. Since the error is not catched, the task fails on each execution, as the offending record is never deleled from assignfeedback_editpdf_queue.
(related question : if we are not using any file converter, can we just disable this scheduled task ?).
Regards