MDL-21432 backup - fix some get_userid() calls
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user