-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
3.9, 3.9.14, 3.10.11, 3.11.7, 4.0.1
-
MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
-
MDL-68774-master
-
Another class of adhoc tasks which seem to get stuck and then get recycled for ever:
core_course\task\course_delete_modules,Coding error detected, it must be fixed by a programmer: The course module 6634253 could not be deleted. #0 /var/www/site/lib/dml/moodle_database.php(1538): moodle_database->get_record_select('course_modules', 'WHERE id = ?', Array, 'id,course', 2)
To reproduce:
- course, with 2 quizzes and 2 questions with images in the question textbox.
- Note: the second quiz should have used the questions from the first quiz via the question bank
- Then export to CSV file the mdl_files record associated with the image q1.
- Move the q1's question bank category to the Quiz level Question Category.
- Re-insert the mdl_files record back in (to fudge the unexpected file record which occasionally occurs in the wild)
- Delete the first Quiz
- Run the cron to execute the course_module_delete adhoc task
At point (6), an attempt will be made to (1) create a new file record at the course level context for the question being "saved" in the "Questions saved from ..." Question Category. But since the mdl_file record exists with the same pathnamehash value, it spits out an error.
The Quiz is hidden from view and appears in the Recycle bin, yet the adhoc_task remains in the queue forever!
- Discovered while testing
-
MDL-68768 Check API checks scheduled task faildelay but not adhoc task fail delay
- Closed
- has a non-specific relationship to
-
MDL-70489 course_delete_modules - remove try catch that hides errors in cron logs
- Open
- has been marked as being related by
-
MDL-59873 Better Error handling when core_course\task\course_delete_modules fails
- Closed