Skip to content

Commit

Permalink
MDL-65649 backup: ensure valid course URL for async mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulholden committed Dec 9, 2019
1 parent 8cf4c97 commit a679ae3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion backup/externallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ public static function get_async_backup_progress($backupids, $contextid) {
require_capability('moodle/backup:backupactivity', $context);
} else {
require_capability('moodle/backup:backupcourse', $context);
$instanceid = $course->id;
}

$results = array();
Expand Down
4 changes: 2 additions & 2 deletions backup/restore.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@
if (is_null($course)) {
$coursefullname = $SITE->fullname;
$courseshortname = $SITE->shortname;
$courseurl = new moodle_url('/');
} else {
$coursefullname = $course->fullname;
$courseshortname = $course->shortname;
$courseurl = course_get_url($course->id);
}

// Show page header.
Expand Down Expand Up @@ -173,7 +175,6 @@
\core\task\manager::queue_adhoc_task($asynctask);

// Add ajax progress bar and initiate ajax via a template.
$courseurl = new moodle_url('/course/view.php', array('id' => $course->id));
$restoreurl = new moodle_url('/backup/restorefile.php', array('contextid' => $contextid));
$progresssetup = array(
'backupid' => $restoreid,
Expand All @@ -182,7 +183,6 @@
'restoreurl' => $restoreurl->out()
);
echo $renderer->render_from_template('core/async_backup_status', $progresssetup);

}

$restore->destroy();
Expand Down

0 comments on commit a679ae3

Please sign in to comment.