Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
294f1790
Commit
294f1790
authored
Sep 30, 2012
by
Angie Byron
Browse files
Issue
#1798756
by andreiashu, alexpott: Fixed Finish conversion of error_level() to CMI.
parent
92a9506e
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/includes/errors.inc
View file @
294f1790
...
...
@@ -250,7 +250,7 @@ function _drupal_log_error($error, $fatal = FALSE) {
$message
=
t
(
'%type: !message in %function (line %line of %file).'
,
$error
);
// Check if verbose error reporting is on.
$error_level
=
variable_get
(
'error_level'
,
ERROR_REPORTING_DISPLAY_ALL
);
$error_level
=
config
(
'system.logging'
)
->
get
(
'error_level'
);
if
(
$error_level
==
ERROR_REPORTING_DISPLAY_VERBOSE
)
{
// First trace is the error itself, already contained in the message.
...
...
core/modules/system/lib/Drupal/system/Tests/System/ErrorHandlerTest.php
View file @
294f1790
...
...
@@ -53,6 +53,15 @@ function testErrorHandler() {
'%file'
=>
drupal_get_path
(
'module'
,
'error_test'
)
.
'/error_test.module'
,
);
// Set error reporting to display verbose notices.
config
(
'system.logging'
)
->
set
(
'error_level'
,
ERROR_REPORTING_DISPLAY_VERBOSE
)
->
save
();
$this
->
drupalGet
(
'error-test/generate-warnings'
);
$this
->
assertResponse
(
200
,
t
(
'Received expected HTTP status code.'
));
$this
->
assertErrorMessage
(
$error_notice
);
$this
->
assertErrorMessage
(
$error_warning
);
$this
->
assertErrorMessage
(
$error_user_notice
);
$this
->
assertRaw
(
'<pre class="backtrace">'
,
'Found pre element with backtrace class.'
);
// Set error reporting to collect notices.
$config
->
set
(
'error_level'
,
ERROR_REPORTING_DISPLAY_ALL
)
->
save
();
$this
->
drupalGet
(
'error-test/generate-warnings'
);
...
...
@@ -60,6 +69,7 @@ function testErrorHandler() {
$this
->
assertErrorMessage
(
$error_notice
);
$this
->
assertErrorMessage
(
$error_warning
);
$this
->
assertErrorMessage
(
$error_user_notice
);
$this
->
assertNoRaw
(
'<pre class="backtrace">'
,
'Did not find pre element with backtrace class.'
);
// Set error reporting to not collect notices.
$config
->
set
(
'error_level'
,
ERROR_REPORTING_DISPLAY_SOME
)
->
save
();
...
...
@@ -68,6 +78,7 @@ function testErrorHandler() {
$this
->
assertNoErrorMessage
(
$error_notice
);
$this
->
assertErrorMessage
(
$error_warning
);
$this
->
assertErrorMessage
(
$error_user_notice
);
$this
->
assertNoRaw
(
'<pre class="backtrace">'
,
'Did not find pre element with backtrace class.'
);
// Set error reporting to not show any errors.
$config
->
set
(
'error_level'
,
ERROR_REPORTING_HIDE
)
->
save
();
...
...
@@ -76,6 +87,7 @@ function testErrorHandler() {
$this
->
assertNoErrorMessage
(
$error_notice
);
$this
->
assertNoErrorMessage
(
$error_warning
);
$this
->
assertNoErrorMessage
(
$error_user_notice
);
$this
->
assertNoRaw
(
'<pre class="backtrace">'
,
'Did not find pre element with backtrace class.'
);
}
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment