-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
3.9.10, 3.10.7, 3.11.3
-
None
-
MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE
Steps to reproduce:
On a fresh install of Moodle:
- Disable cron, so you can see what's happening
- Set Debugging to "Developer"
- Enable asynchronous backups
- Create multiple small test courses (three will do)
- Navigate to one of the test courses and back it up
- Invoke the cron job and observe that the course is backed up
- Return to the course you just backed up and restore the backup as a new course
- Note that "The restore process is pending" and click the link "You can check the progress at any time on the restore page."
- The restore page shows the name of the course
- Navigate to ANY of the other courses you did NOT back up, and visit the restore page for that course.
- Under the section headed "Restores in progress" note that the name of the course being restored
Expected result:
The name of the restore job is the destination of the restore job
Actual result:
The name of the restore job is the name of the course you are currently in.
Cause:
core_backup_renderer::restore_progress_viewer takes two arguments: "userid" and "context". It calls async_helper::get_async_restores to get all the restore jobs for the "userid". But it calls async_helper::get_restore_name to get the name of the restore job from "context".
backup/restorefile.php calls "core_backup_renderer::restore_progress_viewer" with the current context, not the context of the restore job.
The trouble is I can't see a sensible way to get the real context of the restore job. For example, if you are restoring into a new course, the "itemid" in the backup_controller table refers to a course that has the fullname "Course restoration in progress" and shortname "restoring"
- duplicates
-
MDL-66491 Use course name from the backup for async restores
-
- Closed
-