--- devel.module 2011-04-08 04:31:29.000000000 +0100 +++ devel.module 2011-06-01 20:08:16.000000000 +0100 @@ -11,6 +11,7 @@ define('DEVEL_QUERY_SORT_BY_DURATION', 1 define('DEVEL_ERROR_HANDLER_NONE', 0); define('DEVEL_ERROR_HANDLER_STANDARD', 1); define('DEVEL_ERROR_HANDLER_BACKTRACE', 2); +define('DEVEL_ERROR_HANDLER_BACKTRACE_AND_MESSAGE', 3); define('DEVEL_MIN_TEXTAREA', 50); @@ -527,6 +528,7 @@ function devel_set_handler($handler) { // do nothing break; case DEVEL_ERROR_HANDLER_BACKTRACE: + case DEVEL_ERROR_HANDLER_BACKTRACE_AND_MESSAGE: if (has_krumo()) { set_error_handler('backtrace_error_handler'); } @@ -634,6 +636,17 @@ function backtrace_error_handler($error_ } print t('%error: %message in %function (line %line of %file).', $variables) ." =>\n"; krumo($nicetrace); + + // Also show the standard drupal message if this was requested via the admin option for both + // backtrace and message. Create a lookup to convert the watchdog constants into the + // applicable drupal_set_message 'status' value. + $message_status = array(WATCHDOG_ERROR => 'error', + WATCHDOG_WARNING => 'warning', + WATCHDOG_NOTICE => 'warning', + WATCHDOG_DEBUG => 'status'); + if (variable_get('devel_error_handler', DEVEL_ERROR_HANDLER_STANDARD) == DEVEL_ERROR_HANDLER_BACKTRACE_AND_MESSAGE) { + drupal_set_message(t('%error: %message in %function (line %line of %file).', $variables), $message_status[$type[1]]); + } } watchdog('php', '%error: %message in %function (line %line of %file).', $variables, $type[1]); --- devel.admin.inc 2011-04-08 04:31:29.000000000 +0100 +++ devel.admin.inc 2011-05-30 16:43:04.000000000 +0100 @@ -108,11 +108,12 @@ function devel_admin_settings() { $form['devel_error_handler'] = array('#type' => 'radios', '#title' => t('Error handler'), '#default_value' => variable_get('devel_error_handler', DEVEL_ERROR_HANDLER_STANDARD), - '#options' => array(DEVEL_ERROR_HANDLER_NONE => t('None'), DEVEL_ERROR_HANDLER_STANDARD => t('Standard drupal')), + '#options' => array(DEVEL_ERROR_HANDLER_NONE => t('None'), DEVEL_ERROR_HANDLER_STANDARD => t('Standard Drupal')), '#description' => t('Choose an error handler for your site. Backtrace prints nice debug information when an error is noticed, and you choose to show errors on screen. Backtrace requires the krumo library. None is a good option when stepping through the site in your debugger.', array('@krumo' => url('http://krumo.sourceforge.net'), '@choose' => url('admin/config/development/logging'))), ); if (has_krumo()) { $form['devel_error_handler']['#options'][DEVEL_ERROR_HANDLER_BACKTRACE] = t('Backtrace'); + $form['devel_error_handler']['#options'][DEVEL_ERROR_HANDLER_BACKTRACE_AND_MESSAGE] = t('Backtrace plus standard Drupal'); } $options = drupal_map_assoc(array('default', 'blue', 'green', 'orange', 'white', 'disabled'));