diff -u b/core/lib/Drupal/Core/Config/ConfigManager.php b/core/lib/Drupal/Core/Config/ConfigManager.php --- b/core/lib/Drupal/Core/Config/ConfigManager.php +++ b/core/lib/Drupal/Core/Config/ConfigManager.php @@ -17,7 +17,6 @@ use Drupal\Core\StringTranslation\TranslationManager; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Drupal\Core\Extension\ModuleHandlerInterface; -use Drupal\Core\Extension\ThemeHandlerInterface; /** * The ConfigManager provides helper functions for the configuration system. @@ -348,13 +347,7 @@ // @todo ThemeHandler cannot be injected into ConfigManager, since that // causes a circular service dependency. $themes = \Drupal::service('theme_handler')->listInfo(); - foreach ($names as $theme_name) { - if (!isset($themes[$theme_name])) { - return FALSE; - } - } - - return TRUE; + return !((bool) array_diff($names, array_keys($themes))); } /** @@ -368,8 +361,7 @@ protected function validateConfigEntityDependentEntitiesExistence(array $names) { foreach ($names as $config_name) { // Run over all entity type dependencies and fail as soon as possible. - $entity = $this->getEntityByConfigName($config_name); - if (empty($entity)) { + if (!$this->getEntityByConfigName($config_name)) { return FALSE; } }