Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-72792

Course "Restores in progress" always shows name of current course

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 3.9.10, 3.10.7, 3.11.3
    • Backup
    • None
    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE

      Steps to reproduce:

      On a fresh install of Moodle:

      1. Disable cron, so you can see what's happening
      2. Set Debugging to "Developer"
      3. Enable asynchronous backups
      4. Create multiple small test courses (three will do)
      5. Navigate to one of the test courses and back it up
      6. Invoke the cron job and observe that the course is backed up
      7. Return to the course you just backed up and restore the backup as a new course
      8. Note that "The restore process is pending" and click the link "You can check the progress at any time on the restore page."
      9. The restore page shows the name of the course
      10. Navigate to ANY of the other courses you did NOT back up, and visit the restore page for that course.
      11. 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"

            Unassigned Unassigned
            chrisf Chris Fryer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.