diff --git a/core/modules/help/help.module b/core/modules/help/help.module index 444cac5af62c89940a54a7b624f909a26fa93af4..5d5e24a6b1823284307150512bb918ac4bb770b8 100644 --- a/core/modules/help/help.module +++ b/core/modules/help/help.module @@ -148,7 +148,7 @@ function _help_search_update(array $extensions = []): void { return; } - if (_help_is_fully_installed()) { + if (\Drupal::service('update.update_hook_registry')->getInstalledVersion('help') >= 10100) { // Ensure that topics for extensions that have been uninstalled are removed // and that the index state variable is updated. $help_search = \Drupal::service('plugin.manager.search')->createInstance('help_search'); @@ -156,15 +156,3 @@ function _help_search_update(array $extensions = []): void { $help_search->updateIndexState(); } } - -/** - * Checks whether the help module installation is complete. - * - * @return bool - * - * @see \help_update_10200() - */ -function _help_is_fully_installed(): bool { - return \Drupal::service('update.update_hook_registry') - ->getInstalledVersion('help') >= 10200; -} diff --git a/core/modules/help/src/HelpSectionManager.php b/core/modules/help/src/HelpSectionManager.php index 916091b56744c43bb1bd91b273e2eeb68ff787bb..d8037e5082b7ebc729eb765cf2651a3b5f2ad259 100644 --- a/core/modules/help/src/HelpSectionManager.php +++ b/core/modules/help/src/HelpSectionManager.php @@ -57,7 +57,8 @@ public function setSearchManager(?PluginManagerInterface $search_manager = NULL) */ public function clearCachedDefinitions() { parent::clearCachedDefinitions(); - if ($this->searchManager && _help_is_fully_installed()) { + $version = \Drupal::service('update.update_hook_registry')->getInstalledVersion('help'); + if ($this->searchManager && $version >= 10100) { // Rebuild the index on cache clear so that new help topics are indexed // and any changes due to help topics edits or translation changes are // picked up.