diff --git a/core/modules/update/src/UpdateManager.php b/core/modules/update/src/UpdateManager.php index 4faab11..27ec4ff 100644 --- a/core/modules/update/src/UpdateManager.php +++ b/core/modules/update/src/UpdateManager.php @@ -9,6 +9,7 @@ use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\DependencyInjection\DependencySerializationTrait; use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Extension\ThemeHandlerInterface; use Drupal\Core\KeyValueStore\KeyValueFactoryInterface; use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; @@ -64,6 +65,13 @@ class UpdateManager implements UpdateManagerInterface { protected $availableReleasesTempStore; /** + * The theme handler. + * + * @var \Drupal\Core\Extension\ThemeHandlerInterface + */ + protected $themeHandler; + + /** * Constructs a UpdateManager. * * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory @@ -76,8 +84,10 @@ class UpdateManager implements UpdateManagerInterface { * The translation service. * @param \Drupal\Core\KeyValueStore\KeyValueFactoryInterface $key_value_expirable_factory * The expirable key/value factory. + * @param \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler + * The theme handler. */ - public function __construct(ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler, UpdateProcessorInterface $update_processor, TranslationInterface $translation, KeyValueFactoryInterface $key_value_expirable_factory) { + public function __construct(ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler, UpdateProcessorInterface $update_processor, TranslationInterface $translation, KeyValueFactoryInterface $key_value_expirable_factory, ThemeHandlerInterface $theme_handler) { $this->updateSettings = $config_factory->get('update.settings'); $this->moduleHandler = $module_handler; $this->updateProcessor = $update_processor; @@ -123,7 +133,7 @@ public function getProjects() { if (empty($this->projects)) { // Still empty, so we have to rebuild. $module_data = system_rebuild_module_data(); - $theme_data = \Drupal::service('theme_handler')->rebuildThemeData(); + $theme_data = $this->themeHandler->rebuildThemeData(); $project_info = new ProjectInfo(); $project_info->processInfoList($this->projects, $module_data, 'module', TRUE); $project_info->processInfoList($this->projects, $theme_data, 'theme', TRUE);