-
Bug
-
Resolution: Deferred
-
Minor
-
None
-
4.0
-
MOODLE_400_STABLE
Split off from MDL-68773
This leads to the adhoc task failing due to being unable to find the target course.
Findings from there:
The main issue I found is that although there is protection on deleting courses on the UI delete page (/course/delete.php), there are still a number of ways to delete the course before the backup is completed.
It may be better to move the check that looks for a pending backup test into the core api function `delete_courses`. The current implementation - https://github.com/moodle/moodle/blob/master/course/delete.php#L85
Replication Steps
A. core\task\course_backup_task
1. In admin settings, enable asynchronous backups.
2. Create a course.
3. Go to course page.
4. Create a backup of course.
5. Check that the backup is in the pending state.
6. Call the external function `core_course_delete_courses` with the id of the course that has a pending backup.
7. Run the cron tasks.
8. Check that the error appears as the course to backup no longer exists.
- Testing discovered
-
MDL-68773 Adhoc tasks for backup and restore are stuck in endless fail delay loop
- Closed