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

Course deletion via webservice bypasses check for async backups running

XMLWordPrintable

    • 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.

            Unassigned Unassigned
            peterburnett Peter Burnett
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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