reverted: --- b/core/lib/Drupal/Core/EventSubscriber/LegacyRequestSubscriber.php +++ a/core/lib/Drupal/Core/EventSubscriber/LegacyRequestSubscriber.php @@ -27,8 +27,6 @@ */ public function onKernelRequestLegacy(GetResponseEvent $event) { if ($event->getRequestType() == HttpKernelInterface::MASTER_REQUEST) { - // Make sure all but the last bootstrap phase is completed. - drupal_bootstrap(DRUPAL_BOOTSTRAP_CODE); // Prior to invoking hook_init(), initialize the theme (potentially a // custom one for this page), so that: // - Modules with hook_init() implementations that call theme() or diff -u b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php --- b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php @@ -966,7 +966,7 @@ // In case a fatal error occurred that was not in the test process read the // log to pick up any fatal errors. simpletest_log_read($this->testId, $this->databasePrefix, get_class($this), TRUE); - if (!empty($this->container) && $this->container->has('keyvalue')) { + if ($this->container->has('keyvalue')) { $captured_emails = state()->get('system.test_email_collector') ?: array(); $emailCount = count($captured_emails); if ($emailCount) { only in patch2: unchanged: --- a/core/lib/Drupal/Core/HttpKernel.php +++ b/core/lib/Drupal/Core/HttpKernel.php @@ -46,6 +46,9 @@ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQ $this->container->enterScope('request'); $this->container->set('request', $request, 'request'); + // @todo Remove this once everything in the bootstrap has been + // converted to services in the DIC. + drupal_bootstrap(DRUPAL_BOOTSTRAP_CODE); try { $response = parent::handle($request, $type, $catch);