Skip to content

Commit

Permalink
MDL-67731 backup: fix async restores in progress table listing.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulholden committed Mar 22, 2020
1 parent f2fc4a9 commit 5526870
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions backup/util/helper/async_helper.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,17 @@ public static function get_async_backups($renderer, $instanceid) {
$tabledata = array();

// Get relevant backup ids based on context instance id.
$select = 'itemid = ? AND execution = ? AND status < ? AND status > ?';
$params = array($instanceid, backup::EXECUTION_DELAYED, backup::STATUS_FINISHED_ERR, backup::STATUS_NEED_PRECHECK);
$backups = $DB->get_records_select('backup_controllers', $select, $params, 'timecreated DESC', 'id, backupid, timecreated');
$select = 'itemid = :itemid AND execution = :execution AND status < :status1 AND status > :status2 ' .
'AND operation = :operation';
$params = [
'itemid' => $instanceid,
'execution' => backup::EXECUTION_DELAYED,
'status1' => backup::STATUS_FINISHED_ERR,
'status2' => backup::STATUS_NEED_PRECHECK,
'operation' => 'backup',
];

$backups = $DB->get_records_select('backup_controllers', $select, $params, 'timecreated DESC', 'id, backupid, timecreated');
foreach ($backups as $backup) {
$bc = \backup_controller::load_controller($backup->backupid); // Get the backup controller.
$filename = $bc->get_plan()->get_setting('filename')->get_value();
Expand Down

0 comments on commit 5526870

Please sign in to comment.