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
775184ce
Commit
775184ce
authored
Apr 18, 2014
by
Alex Pott
Browse files
Issue
#2223593
by znerol: Decouple the router.request_context service from the request service.
parent
ac0679d7
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/core.services.yml
View file @
775184ce
...
...
@@ -291,8 +291,8 @@ services:
arguments
:
[
'
@database'
,
'
@lock'
]
router.request_context
:
class
:
Symfony\Component\Routing\RequestContext
call
s
:
-
[
fromRequest
,
[
'
@request'
]]
tag
s
:
-
{
name
:
persist
}
router.admin_context
:
class
:
Drupal\Core\Routing\AdminContext
arguments
:
[
'
@request_stack'
]
...
...
@@ -467,7 +467,7 @@ services:
class
:
Symfony\Component\HttpKernel\EventListener\RouterListener
tags
:
-
{
name
:
event_subscriber
}
arguments
:
[
'
@router'
]
arguments
:
[
'
@router'
,
'
@router.request_context'
,
NULL
,
'
@request_stack'
]
content_negotiation
:
class
:
Drupal\Core\ContentNegotiation
view_subscriber
:
...
...
core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
View file @
775184ce
...
...
@@ -1160,6 +1160,12 @@ protected function rebuildContainer($environment = 'testing') {
$this
->
container
->
get
(
'request_stack'
)
->
push
(
$request
);
}
$this
->
container
->
get
(
'current_user'
)
->
setAccount
(
\
Drupal
::
currentUser
());
// The request context is normally set by the router_listener from within
// its KernelEvents::REQUEST listener. In the simpletest parent site this
// event is not fired, therefore it is necessary to updated the request
// context manually here.
$this
->
container
->
get
(
'router.request_context'
)
->
fromRequest
(
$request
);
}
/**
...
...
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