]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19756 Showing exceptions only in DEBUG_DEVELOPER mode
authornicolasconnault <nicolasconnault>
Thu, 13 Aug 2009 03:38:30 +0000 (03:38 +0000)
committernicolasconnault <nicolasconnault>
Thu, 13 Aug 2009 03:38:30 +0000 (03:38 +0000)
lib/outputrenderers.php

index bd293821881d6152f27c8020f95dac4499597bd3..06aaba42a254184d369175d9d5e9a1fda43580e0 100644 (file)
@@ -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') . '</a></p>';
         $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)) {