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

Backup of multiple enrol plugin structures doesn't work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2.5, 3.3.2
    • Fix Version/s: 3.2.6, 3.3.3
    • Component/s: Backup, Enrolments
    • Labels:
    • Testing Instructions:
      Hide

      To test this, one needs to install an enrol plugin that uses plugin backup structure. I've created a sample one in github.

      1. Clone https://github.com/mpetrowi/enrol_zbackuptest.git into enrol/zbackuptest.
      2. Go to the notifications page so that the plugin installs.
      3. In Site Admin -> Plugins -> Enrolments -> "Manage enrol plugins", enable the "Enrolment Backup test" enrol plugin AND the "Publish as LTI tool" plugin.
      4. Create a new course and enter it.
      5. Go to Users->"Enrolment methods" in course administration block.
      6. Add "Enrolment backup test" to the course
      7. Fill in the form with "TEST TERM" and select a role, then click "Add method".
      8. Add "Publish as LTI Tool" enrollment method to the course.
      9. Fill in the form with "Maximum enrolled users" equal to "999", then click "Add method".
      10. Backup the course, being sure to include enrolled users, and download the backup.
      11. Extract the moodle backup and verify that course/enrolment.xml contains both a <plugin_enrol_zbackuptest_enrol> element and a <tool id=?> element. (The later comes from the lti enrollment plugin).
      12. Restore the backup into a new course.
      13. In the new course, go to Users->"Enrolment methods" in course administration block and click on the "Backup test" instance. Verify that term = "TEST TERM".
      14. Go to the previous page and click on the "Publish as LTI Tool" element and verify that "Maximum enrolled users" = "999".
      Show
      To test this, one needs to install an enrol plugin that uses plugin backup structure. I've created a sample one in github. Clone https://github.com/mpetrowi/enrol_zbackuptest.git into enrol/zbackuptest. Go to the notifications page so that the plugin installs. In Site Admin -> Plugins -> Enrolments -> "Manage enrol plugins", enable the "Enrolment Backup test" enrol plugin AND the "Publish as LTI tool" plugin. Create a new course and enter it. Go to Users->"Enrolment methods" in course administration block. Add "Enrolment backup test" to the course Fill in the form with "TEST TERM" and select a role, then click "Add method". Add "Publish as LTI Tool" enrollment method to the course. Fill in the form with "Maximum enrolled users" equal to "999", then click "Add method". Backup the course, being sure to include enrolled users, and download the backup. Extract the moodle backup and verify that course/enrolment.xml contains both a <plugin_enrol_zbackuptest_enrol> element and a <tool id=?> element. (The later comes from the lti enrollment plugin). Restore the backup into a new course. In the new course, go to Users->"Enrolment methods" in course administration block and click on the "Backup test" instance. Verify that term = "TEST TERM". Go to the previous page and click on the "Publish as LTI Tool" element and verify that "Maximum enrolled users" = "999".
    • Affected Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-60121-multi-enrol-backup

      Description

      Enrol plugins can define additional backup structure in the standard way.  However, if two enrol plugins define a backup structure, then only one will get included in backups.  In other words, the backup code allows only one plugin structure of type 'enrol'.

        Attachments

          Activity

            People

            Assignee:
            mpetrowi Matt Petro
            Reporter:
            mpetrowi Matt Petro
            Peer reviewer:
            Mark Nelson
            Integrator:
            Jake Dallimore
            Tester:
            David Mudrák (@mudrd8mz)
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              13/Nov/17