Commit 79b740ac authored by Dries's avatar Dries

- Patch #291026 by Dave Reid, Pasqualle, Rob Loach, et al: improved error reporting settings.

parent b2402f40
......@@ -797,8 +797,10 @@ function _drupal_log_error($error, $fatal = FALSE) {
$number++;
}
// Force display of error messages in update.php.
if (variable_get('error_level', 1) == 1 || (defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'update')) {
// Force display of error messages in update.php or if the proper error
// reporting level is set.
$error_level = variable_get('error_level', 2);
if ($error_level == 2 || ($error_level == 1 && $type != 'Notice') || (defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'update')) {
drupal_set_message(t('%type: %message in %function (line %line of %file).', $error), 'error');
}
......
......@@ -1257,7 +1257,6 @@ function system_site_information_settings_validate($form, &$form_state) {
* @see system_settings_form()
*/
function system_error_reporting_settings() {
$form['site_403'] = array(
'#type' => 'textfield',
'#title' => t('Default 403 (access denied) page'),
......@@ -1266,7 +1265,6 @@ function system_error_reporting_settings() {
'#description' => t('This page is displayed when the requested document is denied to the current user. If unsure, specify nothing.'),
'#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q=')
);
$form['site_404'] = array(
'#type' => 'textfield',
'#title' => t('Default 404 (not found) page'),
......@@ -1275,15 +1273,19 @@ function system_error_reporting_settings() {
'#description' => t('This page is displayed when no other content matches the requested document. If unsure, specify nothing.'),
'#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q=')
);
$form['error_level'] = array(
'#type' => 'select', '#title' => t('Error reporting'),
'#default_value' => 1,
'#options' => array(t('Write errors to the log'), t('Write errors to the log and to the screen')),
'#description' => t('Specify where Drupal, PHP and SQL errors are logged. While it is recommended that a site running in a production environment write errors to the log only, in a development or testing environment it may be helpful to write errors both to the log and to the screen.')
'#type' => 'radios',
'#title' => t('Error reporting'),
'#default_value' => 2,
'#options' => array(
0 => t('Site in production: do not display any errors.'),
1 => t('Site in development: display functional errors only.'),
2 => t('For developers: display all errors.'),
),
'#description' => t('Display settings for error messages. Note that all error messages are always logged.'),
);
return system_settings_form($form, TRUE);
return system_settings_form($form);
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment