MDL-66225 Backup: fix irrecoverable state
Fix condition where if an asynchronous backup completes via the UI and the user refreshes the page a new backup was created with a mismatched backup id. This caused a permanently failing ad-hoc task and blocked further backups for that course.
This commit is contained in:
committed by
Matt Porritt
parent
4fef7d1c87
commit
bf0a0ed189
@@ -123,6 +123,9 @@ if (!async_helper::is_async_pending($id, 'course', 'backup')) {
|
||||
if (!($bc = backup_ui::load_controller($backupid))) {
|
||||
$bc = new backup_controller($type, $id, backup::FORMAT_MOODLE,
|
||||
backup::INTERACTIVE_YES, $backupmode, $USER->id);
|
||||
// The backup id did not relate to a valid controller so we made a new controller.
|
||||
// Now we need to reset the backup id to match the new controller.
|
||||
$backupid = $bc->get_backupid();
|
||||
}
|
||||
|
||||
// Prepare a progress bar which can display optionally during long-running
|
||||
|
||||
Reference in New Issue
Block a user