Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
05c39fe7
Commit
05c39fe7
authored
Jun 10, 2009
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
- Patch
#487830
by c960657: fixed a HTTP header and improved the tests.
parent
d540553f
No related branches found
No related tags found
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
includes/bootstrap.inc
+4
-2
4 additions, 2 deletions
includes/bootstrap.inc
includes/common.inc
+1
-1
1 addition, 1 deletion
includes/common.inc
modules/simpletest/tests/error.test
+5
-0
5 additions, 0 deletions
modules/simpletest/tests/error.test
with
10 additions
and
3 deletions
includes/bootstrap.inc
+
4
−
2
View file @
05c39fe7
...
...
@@ -1403,8 +1403,10 @@ function _drupal_bootstrap($phase) {
}
// Prepare for non-cached page workflow.
if
(
$_SERVER
[
'SERVER_SOFTWARE'
]
!==
'PHP CLI'
)
{
ob_start
();
drupal_page_header
();
}
break
;
case
DRUPAL_BOOTSTRAP_LANGUAGE
:
...
...
This diff is collapsed.
Click to expand it.
includes/common.inc
+
1
−
1
View file @
05c39fe7
...
...
@@ -834,7 +834,7 @@ function _drupal_log_error($error, $fatal = FALSE) {
}
if
(
$fatal
)
{
drupal_set_header
(
$_SERVER
[
'SERVER_PROTOCOL'
]
.
'
500 Service unavailable (with message)'
);
drupal_set_header
(
'
500 Service unavailable (with message)'
);
}
if
(
isset
(
$_SERVER
[
'HTTP_X_REQUESTED_WITH'
])
&&
$_SERVER
[
'HTTP_X_REQUESTED_WITH'
]
==
'XMLHttpRequest'
)
{
...
...
This diff is collapsed.
Click to expand it.
modules/simpletest/tests/error.test
+
5
−
0
View file @
05c39fe7
...
...
@@ -46,6 +46,7 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase {
// Set error reporting to collect notices.
variable_set
(
'error_level'
,
ERROR_REPORTING_DISPLAY_ALL
);
$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
);
...
...
@@ -53,6 +54,7 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase {
// Set error reporting to not collect notices.
variable_set
(
'error_level'
,
ERROR_REPORTING_DISPLAY_SOME
);
$this
->
drupalGet
(
'error-test/generate-warnings'
);
$this
->
assertResponse
(
200
,
t
(
'Received expected HTTP status code.'
));
$this
->
assertNoErrorMessage
(
$error_notice
);
$this
->
assertErrorMessage
(
$error_warning
);
$this
->
assertErrorMessage
(
$error_user_notice
);
...
...
@@ -60,6 +62,7 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase {
// Set error reporting to not show any errors.
variable_set
(
'error_level'
,
ERROR_REPORTING_HIDE
);
$this
->
drupalGet
(
'error-test/generate-warnings'
);
$this
->
assertResponse
(
200
,
t
(
'Received expected HTTP status code.'
));
$this
->
assertNoErrorMessage
(
$error_notice
);
$this
->
assertNoErrorMessage
(
$error_warning
);
$this
->
assertNoErrorMessage
(
$error_user_notice
);
...
...
@@ -85,9 +88,11 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase {
);
$this
->
drupalGet
(
'error-test/trigger-exception'
);
$this
->
assertTrue
(
strpos
(
$this
->
drupalGetHeader
(
':status'
),
'500 Service unavailable (with message)'
),
t
(
'Received expected HTTP status line.'
));
$this
->
assertErrorMessage
(
$error_exception
);
$this
->
drupalGet
(
'error-test/trigger-pdo-exception'
);
$this
->
assertTrue
(
strpos
(
$this
->
drupalGetHeader
(
':status'
),
'500 Service unavailable (with message)'
),
t
(
'Received expected HTTP status line.'
));
// We cannot use assertErrorMessage() since the extact error reported
// varies from database to database. Check that the SQL string is displayed.
$this
->
assertText
(
$error_pdo_exception
[
'%type'
],
t
(
'Found %type in error page.'
,
$error_pdo_exception
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment