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

Restoring course with non-default enrollment methods does not restore those enrollment methods if users aren't also restored

    XMLWordPrintable

    Details

    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull Master Branch:
      wip-MDL-40838-master-2
    • Testing Instructions:
      Hide
      1. Create a course with non default enrolment methods with some enrolled users (do not use cohorts because it automatically enrols same users even if they were not in the backup and it will be confusing during the test)
      2. Make two backups - with and without user information
      3. Restore the backups and make sure you have an option of restoring enrollment methods. Try all combinations
        • users&enrollments
        • users without enrollments (should be restored as manual)
        • without users but with enrollments (this is the requested use case)
        • without users and without enrollments
      4. Try restoring the backups into another course with deleting or merging, it should work too.
      5. Remove from manager role capability moodle/course:enrolconfig, login as manager and try restoring the same backup: you should see that enrolment methods are locked by permission, make sure they will not be restored

      Please note that enrollment methods are always included in the backup and there is no option not to include them. This also means that backups without user information that were made before this patch can also be restored with enrollment methods after the patch

      Show
      Create a course with non default enrolment methods with some enrolled users (do not use cohorts because it automatically enrols same users even if they were not in the backup and it will be confusing during the test) Make two backups - with and without user information Restore the backups and make sure you have an option of restoring enrollment methods. Try all combinations users&enrollments users without enrollments (should be restored as manual) without users but with enrollments (this is the requested use case) without users and without enrollments Try restoring the backups into another course with deleting or merging, it should work too. Remove from manager role capability moodle/course:enrolconfig, login as manager and try restoring the same backup: you should see that enrolment methods are locked by permission, make sure they will not be restored Please note that enrollment methods are always included in the backup and there is no option not to include them. This also means that backups without user information that were made before this patch can also be restored with enrollment methods after the patch
    • Sprint:
      3.3 sprint 3

      Description

      If you have a course with non-default enrollment methods (methods other than manual, self, and guest), upon restoring a backup of that course without users, the restored course only contains the default methods. If you restore the course with users then (some of?) the correct methods are restored with the course.

      Steps to reproduce:

      1. Create a course and edit the enrollment methods. Remove the default methods (manual, self, and guest). Add non-default methods such as Cohort Sync and Flat File.
      2. Make a backup of this course including user data.
      3. Restore the backup without user data.
      4. In the restored course, go to the enrollment methods and note that the default methods (manual, self, and guest) were added but Cohort and Flat File were not. This is not what users expect; they expect to have Cohort and Flat File.
      5. Restore the backup to a new course, this time with user data.
      6. In the second restored course, go to the enrollment methods and note that the Cohort method was added to the course (this is expected) and the default methods were not added (this is also expected). Flat file is expected to be there but for some reason it isn't.

      This problem just started happening after we applied the fix from this issue: MDL-28394

      Prior to that fix, repeating the same steps above would result in #4 and #6 both having the enrollment methods from the backup restored in the course and in neither case were the default methods added.

      I understand why the fix in MDL-28394 was made but it seems to need a further tweak so that the enrollment methods existing in the backup are restored even if users are not. Admins and instructors expect the non-default methods to be restored without users the same way they are if users are restored.

        Attachments

        1. after.png
          after.png
          19 kB
        2. before.png
          before.png
          18 kB
        3. dropdown.png
          dropdown.png
          29 kB

          Issue Links

            Activity

              People

              Assignee:
              marina Marina Glancy
              Reporter:
              cfollin Chris Follin
              Peer reviewer:
              Jake Dallimore Jake Dallimore
              Integrator:
              David Monllaó David Monllaó
              Tester:
              Rajesh Taneja Rajesh Taneja
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              5 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/May/17