From: nicolasconnault Date: Thu, 13 Aug 2009 03:38:30 +0000 (+0000) Subject: MDL-19756 Showing exceptions only in DEBUG_DEVELOPER mode X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e57c283df51ac989fa722a154007d0a835539464;p=moodle.git MDL-19756 Showing exceptions only in DEBUG_DEVELOPER mode --- diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index bd29382188..06aaba42a2 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -1676,7 +1676,7 @@ class moodle_core_renderer extends moodle_renderer_base { */ public function radio($option, $name='unnamed') { static $currentradio = array(); - + if (empty($currentradio[$name])) { $currentradio[$name] = 0; } @@ -1847,6 +1847,10 @@ class moodle_core_renderer extends moodle_renderer_base { $output = ''; + if (!debugging('', DEBUG_DEVELOPER)) { + return false; + } + if ($this->has_started()) { $output .= $this->opencontainers->pop_all_but_last(); } else { @@ -1861,18 +1865,16 @@ class moodle_core_renderer extends moodle_renderer_base { get_string('moreinformation') . '

'; $output .= $this->box($message, 'errorbox'); - if (debugging('', DEBUG_DEVELOPER)) { - if ($showerrordebugwarning) { - $output .= $this->notification('error() is a deprecated function. ' . - 'Please call print_error() instead of error()', 'notifytiny'); - } - if (!empty($debuginfo)) { - $output .= $this->notification($debuginfo, 'notifytiny'); - } - if (!empty($backtrace)) { - $output .= $this->notification('Stack trace: ' . - format_backtrace($backtrace), 'notifytiny'); - } + if ($showerrordebugwarning) { + $output .= $this->notification('error() is a deprecated function. ' . + 'Please call print_error() instead of error()', 'notifytiny'); + } + if (!empty($debuginfo)) { + $output .= $this->notification($debuginfo, 'notifytiny'); + } + if (!empty($backtrace)) { + $output .= $this->notification('Stack trace: ' . + format_backtrace($backtrace), 'notifytiny'); } if (!empty($link)) {