Commit 04a36a55 authored by Tyler Struyk's avatar Tyler Struyk
Browse files

Drupal core issue #2788087: Problem with temporary copy of non-exist route.

parent 1fca6552
......@@ -105,6 +105,9 @@
},
"drupal/externalauth": {
"ISTWCMS-2267: Remove provider prefix to username (samlauth_)": "patches/modules/externalauth/optional_prefix-externalauth-2798323-17.patch"
},
"drupal/core": {
"Drupal issue #2788087, problem with temporary route not existing": "patches/modules/core/2788087-7.patch"
}
}
}
......
diff --git a/core/lib/Drupal/Core/Extension/ModuleInstaller.php b/core/lib/Drupal/Core/Extension/ModuleInstaller.php
index 0dfe322..db57550 100644
--- a/core/lib/Drupal/Core/Extension/ModuleInstaller.php
+++ b/core/lib/Drupal/Core/Extension/ModuleInstaller.php
@@ -293,7 +293,11 @@ public function install(array $module_list, $enable_dependencies = TRUE) {
// If any modules were newly installed, invoke hook_modules_installed().
if (!empty($modules_installed)) {
- \Drupal::getContainer()->set('router.route_provider', \Drupal::service('router.route_provider.old'));
+ // When some code rebuilt the container, the container no longer has the
+ // old route provider.
+ if (\Drupal::hasService('router.route_provider.old')) {
+ \Drupal::getContainer()->set('router.route_provider', \Drupal::service('router.route_provider.old'));
+ }
if (!\Drupal::service('router.route_provider.lazy_builder')->hasRebuilt()) {
// Rebuild routes after installing module. This is done here on top of
// \Drupal\Core\Routing\RouteBuilder::destruct to not run into errors on
Supports Markdown
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