Commit 775184ce authored by alexpott's avatar alexpott

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

parent ac0679d7
......@@ -291,8 +291,8 @@ services:
arguments: ['@database', '@lock']
router.request_context:
class: Symfony\Component\Routing\RequestContext
calls:
- [fromRequest, ['@request']]
tags:
- { 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:
......
......@@ -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);
}
/**
......
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