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

Ability to backup and restore of enrolment plugins data

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      A) To test the additional functionality, one needs to install an enrol plugin that uses the new features. I've created a sample one in github.

      1. Clone https://github.com/mpetrowi/enrol_backuptest.git into enrol/backuptest.
      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.
      4. Create a new course.
      5. Go to Users->"Enrolment methods" in course administration block.
      6. Add "Enrolment backup test" to the course
      7. Fill in the form with some value for term and select a role, then click "Add method".
      8. Backup the course.
      9. Restore the backup into a new course.
      10. In the new course, go to Users->"Enrolment methods" in course administration block and click on the "Backup test" instance
      11. Verify that term and role are the same as were set in the first course.

      B) Ensure both phpunit and behat (@core_backup) work without a problem.

      C) Verify old backups, not containing enrol plugin support, continue restoring without problem. For that purpose, the backup file attached @ MDL-44053 can be used. It should end without any warning related to enrollments and with 1 "facilitator" and 2 "learners" after restore.

      Show
      A) To test the additional functionality, one needs to install an enrol plugin that uses the new features. I've created a sample one in github. Clone https://github.com/mpetrowi/enrol_backuptest.git into enrol/backuptest. 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. Create a new course. Go to Users->"Enrolment methods" in course administration block. Add "Enrolment backup test" to the course Fill in the form with some value for term and select a role, then click "Add method". Backup the course. 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 and role are the same as were set in the first course. B) Ensure both phpunit and behat (@core_backup) work without a problem. C) Verify old backups, not containing enrol plugin support, continue restoring without problem. For that purpose, the backup file attached @ MDL-44053 can be used. It should end without any warning related to enrollments and with 1 "facilitator" and 2 "learners" after restore.
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Pull Master Branch:
      MDL-47323-enrol-plugin-backup

      Description

      Currently there is no allowance for enrol plugins to define additional backup structure or to annotate custom enrol fields. The proposed changes address these shortcomings.

      The changes are:

      1. Add a backup plugin structure for enrol, as well as new backup/restore plugin classes.
      2. Add a backup execution step which calls a new method enrol_plugin::backup_annotate_custom_fields() in which plugins can annotate custom fields.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mpetrowi Matt Petro
              Reporter:
              mpetrowi Matt Petro
              Peer reviewer:
              Eloy Lafuente (stronk7)
              Integrator:
              Dan Poltawski
              Tester:
              John Okely
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/Jan/15