Skip to content
Snippets Groups Projects
Unverified Commit 165ba7ec authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2795789 by Fabianx, jibran, dawehner, alexpott: Do not rebuild the container so often in BTB

parent d4f1cb5a
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -383,10 +383,13 @@ protected function initUserSession() {
*/
protected function initKernel(Request $request) {
$this->kernel = DrupalKernel::createFromRequest($request, $this->classLoader, 'prod', TRUE);
$this->kernel->prepareLegacyRequest($request);
// Force the container to be built from scratch instead of loaded from the
// disk. This forces us to not accidentally load the parent site.
return $this->kernel->rebuildContainer();
$this->kernel->invalidateContainer();
$this->kernel->prepareLegacyRequest($request);
return \Drupal::getContainer();
}
/**
......@@ -420,8 +423,8 @@ protected function installModulesFromClassProperty(ContainerInterface $container
// The exception message has all the details.
$this->fail($e->getMessage());
}
$this->rebuildContainer();
// The container was already rebuilt by the ModuleInstaller.
$this->container = \Drupal::getContainer();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment