Merge branch 'MDL-47323-enrol-plugin-backup' of https://github.com/mpetrowi/moodle
[moodle.git] / backup / moodle2 / restore_stepslib.php
index 7df7a2e..bd0b08f 100644 (file)
@@ -1884,12 +1884,12 @@ class restore_enrolments_structure_step extends restore_structure_step {
 
     protected function define_structure() {
 
-        $paths = array();
-
-        $paths[] = new restore_path_element('enrol', '/enrolments/enrols/enrol');
-        $paths[] = new restore_path_element('enrolment', '/enrolments/enrols/enrol/user_enrolments/enrolment');
+        $enrol = new restore_path_element('enrol', '/enrolments/enrols/enrol');
+        $enrolment = new restore_path_element('enrolment', '/enrolments/enrols/enrol/user_enrolments/enrolment');
+        // Attach local plugin stucture to enrol element.
+        $this->add_plugin_structure('enrol', $enrol);
 
-        return $paths;
+        return array($enrol, $enrolment);
     }
 
     /**