From dc8a848c7d50ed3da467ce46a1829a7fcf066a2a Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Fri, 28 Mar 2014 16:39:55 +0800 Subject: [PATCH] MDL-41102 report_performance: correctly check state of automated backups Thanks to Renaat Debleu for the patch --- report/performance/locallib.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/report/performance/locallib.php b/report/performance/locallib.php index 993054638bb..6ff7ea4fa28 100644 --- a/report/performance/locallib.php +++ b/report/performance/locallib.php @@ -232,16 +232,19 @@ class report_performance { */ public static function report_performance_check_automatic_backup() { global $CFG; + require_once($CFG->dirroot . '/backup/util/helper/backup_cron_helper.class.php'); + $issueresult = new report_performance_issue(); $issueresult->issue = 'report_performance_check_automatic_backup'; $issueresult->name = get_string('check_backup', 'report_performance'); - if (!empty($CFG->backup_auto_active) && ($CFG->backup_auto_active == 1)) { + $automatedbackupsenabled = get_config('backup', 'backup_auto_active'); + if ($automatedbackupsenabled == backup_cron_automated_helper::AUTO_BACKUP_ENABLED) { $issueresult->statusstr = get_string('autoactiveenabled', 'backup'); $issueresult->status = self::REPORT_PERFORMANCE_WARNING; $issueresult->comment = get_string('check_backup_comment_enable', 'report_performance'); } else { - if (empty($CFG->backup_auto_active)) { + if ($automatedbackupsenabled == backup_cron_automated_helper::AUTO_BACKUP_DISABLED) { $issueresult->statusstr = get_string('autoactivedisabled', 'backup'); } else { $issueresult->statusstr = get_string('autoactivemanual', 'backup'); -- 2.43.0