MDL-29618 backup - back to handling enrolments properly. Regession of MDL-26841,...
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Sun, 2 Oct 2011 22:45:18 +0000 (00:45 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Sun, 2 Oct 2011 22:45:18 +0000 (00:45 +0200)
backup/moodle2/backup_course_task.class.php
backup/moodle2/restore_course_task.class.php

index 41dcaee..070506c 100644 (file)
@@ -73,7 +73,7 @@ class backup_course_task extends backup_task {
         $this->add_step(new backup_course_structure_step('course_info', 'course.xml'));
 
         // Generate the enrolment file (conditionally, prevent it in any IMPORT/HUB operation)
-        if (!$this->plan->get_mode() == backup::MODE_IMPORT && !$this->plan->get_mode() == backup::MODE_HUB) {
+        if ($this->plan->get_mode() != backup::MODE_IMPORT && $this->plan->get_mode() != backup::MODE_HUB) {
             $this->add_step(new backup_enrolments_structure_step('course_enrolments', 'enrolments.xml'));
         }
 
index 989e5a7..fb441f8 100644 (file)
@@ -70,7 +70,7 @@ class restore_course_task extends restore_task {
         $this->add_step(new restore_ras_and_caps_structure_step('course_ras_and_caps', 'roles.xml'));
 
         // Restore course enrolments (plugins and membership). Conditionally prevented for any IMPORT/HUB operation
-        if (!$this->plan->get_mode() == backup::MODE_IMPORT && !$this->plan->get_mode() == backup::MODE_HUB) {
+        if ($this->plan->get_mode() != backup::MODE_IMPORT && $this->plan->get_mode() != backup::MODE_HUB) {
             $this->add_step(new restore_enrolments_structure_step('course_enrolments', 'enrolments.xml'));
         }