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

Cannot restore an activity if the user owns only one course

    XMLWordPrintable

Details

    • MOODLE_22_STABLE, MOODLE_25_STABLE
    • MOODLE_27_STABLE, MOODLE_28_STABLE
    • MDL-35494_master
    • Hide

      Rather than using the restore link in course administration, go into any activity in the course e.g. the news forum and click the link Administration > Forum administration > Restore.

      You will then be given the option to restore into an existing course, where you can select your one and only course.

      Show
      Rather than using the restore link in course administration, go into any activity in the course e.g. the news forum and click the link Administration > Forum administration > Restore. You will then be given the option to restore into an existing course, where you can select your one and only course.
    • Hide
      1. Visit a site that has only one course.
      2. Visit the course then under 'Course administration' choose 'Restore'.
      3. Use the attached file (quiz.mbz) as your backup file and click 'Restore'.
      4. Go through the restore process and make sure everything works as expected.
      Show
      Visit a site that has only one course. Visit the course then under 'Course administration' choose 'Restore'. Use the attached file (quiz.mbz) as your backup file and click 'Restore'. Go through the restore process and make sure everything works as expected.
    • BACKEND Sprint 18

    Description

      If the user/instructor has only one course, s/he cannot pick the course after uploading an activity file. The user got an error message instead:

      "There are no categories or existing courses you can restore to."

      Looking at /backup/util/ui/renderer.php, line 256 calls $courses->get_count(), which doesn't include current course, thus returning 0. $courses->set_include_currentcourse() is only called if the code can get pass the get_count() condition. Thus, for a user with only 1 course, this is a deadlock.

      Given the fact that the user can proceed normally if s/he has restore capability in more than 1 courses, I assume this is a bug.

      Moodle 2.2.4+ (Build: 20120831)

      Attachments

        Activity

          People

            markn Mark Nelson
            sillyxone Huy Hoang
            Ankit Agarwal Ankit Agarwal
            Sam Hemelryk Sam Hemelryk
            Andrew Lyons Andrew Lyons
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski
            Votes:
            14 Vote for this issue
            Watchers:
            13 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              12/Jan/15