Skip to content

Commit

Permalink
Merge branch 'MDL-67731-37' of https://github.com/paulholden/moodle i…
Browse files Browse the repository at this point in the history
…nto MOODLE_37_STABLE
  • Loading branch information
stronk7 committed Mar 24, 2020
2 parents 72c744d + b167974 commit 02d491f
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions backup/util/helper/async_helper.class.php
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 02d491f

Please sign in to comment.