diff -u b/core/core.services.yml b/core/core.services.yml --- b/core/core.services.yml +++ b/core/core.services.yml @@ -114,7 +114,7 @@ - { name: page_cache_response_policy } config.manager: class: Drupal\Core\Config\ConfigManager - arguments: ['@entity.manager', '@config.factory', '@config.typed', '@string_translation', '@config.storage', '@event_dispatcher', '@module_handler', '@theme_handler'] + arguments: ['@entity.manager', '@config.factory', '@config.typed', '@string_translation', '@config.storage', '@event_dispatcher', '@module_handler'] config.factory: class: Drupal\Core\Config\ConfigFactory tags: 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 @@ -68,13 +68,6 @@ protected $moduleHandler; /** - * The theme handler service. - * - * @var \Drupal\Core\Extension\ThemeHandlerInterface - */ - protected $themeHandler; - - /** * The configuration collection info. * * @var \Drupal\Core\Config\ConfigCollectionInfo @@ -103,8 +96,10 @@ * The active configuration storage. * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher * The event dispatcher. + * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler + * The module handler. */ - public function __construct(EntityManagerInterface $entity_manager, ConfigFactoryInterface $config_factory, TypedConfigManagerInterface $typed_config_manager, TranslationManager $string_translation, StorageInterface $active_storage, EventDispatcherInterface $event_dispatcher, ModuleHandlerInterface $module_handler, ThemeHandlerInterface $theme_handler) { + public function __construct(EntityManagerInterface $entity_manager, ConfigFactoryInterface $config_factory, TypedConfigManagerInterface $typed_config_manager, TranslationManager $string_translation, StorageInterface $active_storage, EventDispatcherInterface $event_dispatcher, ModuleHandlerInterface $module_handler) { $this->entityManager = $entity_manager; $this->configFactory = $config_factory; $this->typedConfigManager = $typed_config_manager; @@ -112,7 +107,6 @@ $this->activeStorage = $active_storage; $this->eventDispatcher = $event_dispatcher; $this->moduleHandler = $module_handler; - $this->themeHandler = $theme_handler; } /** @@ -351,7 +345,9 @@ * Whether or not all modules and themes are enabled. */ protected function validateConfigEntityDependentThemesExistence(array $names) { - $themes = $this->themeHandler->listInfo(); + // @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; diff -u b/core/modules/config/src/Form/ConfigSingleImportForm.php b/core/modules/config/src/Form/ConfigSingleImportForm.php --- b/core/modules/config/src/Form/ConfigSingleImportForm.php +++ b/core/modules/config/src/Form/ConfigSingleImportForm.php @@ -202,7 +202,7 @@ // Validate existence of configuration entity dependents. if (!empty($data['dependencies'])) { if (!$this->configManager->validateConfigEntityDependentsExistence($data['dependencies'])) { - $this->setFormError('import', $form_state, $this->t('Missing dependencies have been found. Import them first.')); + $form_state->setErrorByName('import', $this->t('Missing dependencies have been found. Import them first.')); } } diff -u b/core/modules/config/src/Tests/ConfigDependencyTest.php b/core/modules/config/src/Tests/ConfigDependencyTest.php --- b/core/modules/config/src/Tests/ConfigDependencyTest.php +++ b/core/modules/config/src/Tests/ConfigDependencyTest.php @@ -24,6 +24,17 @@ public static $modules = array('system', 'config_test'); /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + + // Install Stark theme, as \Drupal\simpletest\KernelTestBase doesn't install + // it be default. + \Drupal::service('theme_handler')->install(array('stark')); + } + + /** * Tests that calculating dependencies for system module. */ public function testNonEntity() {