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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
28c6dffa
Commit
28c6dffa
authored
12 years ago
by
Larry Garfield
Browse files
Options
Downloads
Patches
Plain Diff
Reset the static menu systme variables before a 404 subrequest, too.
parent
3edf21c2
Branches
Branches containing commit
Tags
Tags containing commit
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
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/lib/Drupal/Core/ExceptionController.php
+16
-0
16 additions, 0 deletions
core/lib/Drupal/Core/ExceptionController.php
with
16 additions
and
0 deletions
core/lib/Drupal/Core/ExceptionController.php
+
16
−
0
View file @
28c6dffa
...
...
@@ -325,6 +325,22 @@ public function on404Html(FlattenException $exception, Request $request) {
// normal system path in the site_404 variable.
$subrequest
=
Request
::
create
(
'/'
.
$path
,
'get'
,
array
(),
$request
->
cookies
->
all
(),
array
(),
$request
->
server
->
all
());
// The active trail is being statically cached from the parent request to
// the subrequest, like any other static. Unfortunately that means the
// data in it is incorrect and does not get regenerated correctly for
// the subrequest. In this instance, that even causes a fatal error in
// some circumstances because menu_get_active_trail() ends up having
// a missing localized_options value. To work around that, reset the
// menu static variables and let them be regenerated as needed.
// @todo It is likely that there are other such statics that need to be
// reset that are not triggering test failures right now. If found,
// add them here.
// @todo Refactor the breadcrumb system so that it does not rely on static
// variables in the first place, which will eliminate the need for this
// hack.
drupal_static_reset
(
'menu_set_active_trail'
);
menu_reset_static_cache
();
$response
=
$this
->
kernel
->
handle
(
$subrequest
,
HttpKernelInterface
::
SUB_REQUEST
);
$response
->
setStatusCode
(
404
,
'Not Found'
);
}
...
...
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