From 7edc187fb78769ab24fbc5f17c302f8a6ae9d398 Mon Sep 17 00:00:00 2001 From: Shamim Rezaie Date: Wed, 7 Feb 2018 14:35:36 +1100 Subject: [PATCH] MDL-61377 Core: Fixed faulty warning when using progress_bar --- lib/outputcomponents.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php index 26a34471a7b..c696d607119 100644 --- a/lib/outputcomponents.php +++ b/lib/outputcomponents.php @@ -4767,8 +4767,8 @@ class progress_bar implements renderable, templatable { * @param bool $autostart Whether to start the progress bar right away. */ public function __construct($htmlid = '', $width = 500, $autostart = false) { - if (!defined('NO_OUTPUT_BUFFERING') || !NO_OUTPUT_BUFFERING) { - debugging('progress_bar used without setting NO_OUTPUT_BUFFERING.', DEBUG_DEVELOPER); + if (!CLI_SCRIPT && !NO_OUTPUT_BUFFERING) { + debugging('progress_bar used in a non-CLI script without setting NO_OUTPUT_BUFFERING.', DEBUG_DEVELOPER); } if (!empty($htmlid)) {