diff --git a/core/lib/Drupal/Core/Update/UpdateCompilerPass.php b/core/lib/Drupal/Core/Update/UpdateCompilerPass.php index 9da1323211..6ac05886d0 100644 --- a/core/lib/Drupal/Core/Update/UpdateCompilerPass.php +++ b/core/lib/Drupal/Core/Update/UpdateCompilerPass.php @@ -41,14 +41,13 @@ public function process(ContainerBuilder $container) { } } } - // Repeat if services or aliases have been removed. + // Repeat if services have been removed. } while ($has_changed); - // We only need to check aliases is we've removed a service because - // references to aliases have already been resolved by Symfony's - // ResolveReferencesToAliasesPass. + // Remove aliases to services that have been removed. This does not need to + // be part of the loop above because references to aliases have already been + // resolved by Symfony's ResolveReferencesToAliasesPass. if ($process_aliases) { - // Remove any aliases which point to undefined services. foreach ($container->getAliases() as $key => $alias) { $id = (string) $alias; if (!$container->has($id)) { diff --git a/core/modules/system/tests/src/Functional/Update/UpdatePathNewDependencyTest.php b/core/modules/system/tests/src/Functional/Update/UpdatePathNewDependencyTest.php index 8076a83e98..57a53278c4 100644 --- a/core/modules/system/tests/src/Functional/Update/UpdatePathNewDependencyTest.php +++ b/core/modules/system/tests/src/Functional/Update/UpdatePathNewDependencyTest.php @@ -38,7 +38,6 @@ public function testUpdateNewDependency() { // Rebuild the container and test that the service with the optional unmet // dependency is still available while the ones that fail are not. - try { $this->rebuildContainer(); $this->fail('The container has services with unmet dependencies and should have failed to rebuild.');