diff --git a/backup/moodle2/restore_stepslib.php b/backup/moodle2/restore_stepslib.php index 9dcb7cc7963..be2bc8a4817 100644 --- a/backup/moodle2/restore_stepslib.php +++ b/backup/moodle2/restore_stepslib.php @@ -358,7 +358,7 @@ class restore_scales_structure_step extends restore_structure_step { ORDER BY courseid", $params, IGNORE_MULTIPLE)) { // Remap the user if possible, defaut to user performing the restore if not $userid = $this->get_mappingid('user', $data->userid); - $data->userid = $userid ? $userid : $this->get_userid(); + $data->userid = $userid ? $userid : $this->task->get_userid(); // Remap the course if course scale $data->courseid = $data->courseid ? $this->get_courseid() : 0; // If global scale (course=0), check the user has perms to create it @@ -418,7 +418,7 @@ class restore_outcomes_structure_step extends restore_structure_step { ORDER BY COALESCE(courseid, 0)', $params, IGNORE_MULTIPLE)) { // Remap the user $userid = $this->get_mappingid('user', $data->usermodified); - $data->usermodified = $userid ? $userid : $this->get_userid(); + $data->usermodified = $userid ? $userid : $this->task->get_userid(); // Remap the scale $data->scaleid = $this->get_mappingid('scale', $data->scaleid); // Remap the course if course outcome diff --git a/backup/util/plan/restore_structure_step.class.php b/backup/util/plan/restore_structure_step.class.php index 500bb81414e..084591a9406 100644 --- a/backup/util/plan/restore_structure_step.class.php +++ b/backup/util/plan/restore_structure_step.class.php @@ -286,7 +286,7 @@ abstract class restore_structure_step extends restore_step { // Re-enforce 'moodle/restore:rolldates' capability for the user in the course, just in case } else if (!has_capability('moodle/restore:rolldates', get_context_instance(CONTEXT_COURSE, $this->get_courseid()), - $this->get_userid())) { + $this->task->get_userid())) { $cache[$this->get_restoreid()] = 0; // Arrived here, let's calculate the real offset