Commit 775184ce authored by alexpott's avatar alexpott
Browse files

Issue #2223593 by znerol: Decouple the router.request_context service from the request service.

parent ac0679d7
...@@ -291,8 +291,8 @@ services: ...@@ -291,8 +291,8 @@ services:
arguments: ['@database', '@lock'] arguments: ['@database', '@lock']
router.request_context: router.request_context:
class: Symfony\Component\Routing\RequestContext class: Symfony\Component\Routing\RequestContext
calls: tags:
- [fromRequest, ['@request']] - { name: persist }
router.admin_context: router.admin_context:
class: Drupal\Core\Routing\AdminContext class: Drupal\Core\Routing\AdminContext
arguments: ['@request_stack'] arguments: ['@request_stack']
...@@ -467,7 +467,7 @@ services: ...@@ -467,7 +467,7 @@ services:
class: Symfony\Component\HttpKernel\EventListener\RouterListener class: Symfony\Component\HttpKernel\EventListener\RouterListener
tags: tags:
- { name: event_subscriber } - { name: event_subscriber }
arguments: ['@router'] arguments: ['@router', '@router.request_context', NULL, '@request_stack']
content_negotiation: content_negotiation:
class: Drupal\Core\ContentNegotiation class: Drupal\Core\ContentNegotiation
view_subscriber: view_subscriber:
......
...@@ -1160,6 +1160,12 @@ protected function rebuildContainer($environment = 'testing') { ...@@ -1160,6 +1160,12 @@ protected function rebuildContainer($environment = 'testing') {
$this->container->get('request_stack')->push($request); $this->container->get('request_stack')->push($request);
} }
$this->container->get('current_user')->setAccount(\Drupal::currentUser()); $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);
} }
/** /**
......
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