MDL-21432 backup - fix some get_userid() calls

This commit is contained in:
Eloy Lafuente
2010-07-22 08:19:21 +00:00
parent 86875a83c0
commit ba8bead5b6
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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
@@ -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