From 1573479d833cd681b5261def79f9c5d1cd4c875a Mon Sep 17 00:00:00 2001 From: catch <6915-catch@users.noreply.drupalcode.org> Date: Thu, 18 Jul 2024 23:45:01 +0900 Subject: [PATCH] Issue #3376516 by andypost, quietone: Remove check for 10200 update from help module (cherry picked from commit 5a3ca12753777ac8c8d23b17007b43f46d8e2bd8) --- core/modules/help/help.module | 12 +++++------- core/modules/help/src/HelpSectionManager.php | 5 +++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/core/modules/help/help.module b/core/modules/help/help.module index 84eaf5482b70..659ad8d94172 100644 --- a/core/modules/help/help.module +++ b/core/modules/help/help.module @@ -148,11 +148,9 @@ function _help_search_update(array $extensions = []): void { return; } - if (\Drupal::service('update.update_hook_registry')->getInstalledVersion('help') >= 10200) { - // 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'); - $help_search->updateTopicList(); - $help_search->updateIndexState(); - } + // 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'); + $help_search->updateTopicList(); + $help_search->updateIndexState(); } diff --git a/core/modules/help/src/HelpSectionManager.php b/core/modules/help/src/HelpSectionManager.php index 656ab14dc199..2ef90d9e331a 100644 --- a/core/modules/help/src/HelpSectionManager.php +++ b/core/modules/help/src/HelpSectionManager.php @@ -58,8 +58,9 @@ public function setSearchManager(?PluginManagerInterface $search_manager = NULL) */ public function clearCachedDefinitions() { parent::clearCachedDefinitions(); - $version = \Drupal::service('update.update_hook_registry')->getInstalledVersion('help'); - if ($this->searchManager && $version >= 10200) { + // Search module may be missing. Help module might be installing, + // so its search plugin may not be discovered yet. + if ($this->searchManager && $this->searchManager->hasDefinition('help_search')) { // 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. -- GitLab