Revert "Issue #3376376: HelpSectionManager::clearCachedDefinitions breaks the update system"

This reverts commit e482afdd29.
merge-requests/4177/merge
Lee Rowlands 2023-07-24 18:53:37 +10:00
parent da8c8f98a4
commit a3433391e7
No known key found for this signature in database
GPG Key ID: 2B829A3DF9204DC4
2 changed files with 3 additions and 14 deletions

View File

@ -148,7 +148,7 @@ function _help_search_update(array $extensions = []): void {
return; 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 // Ensure that topics for extensions that have been uninstalled are removed
// and that the index state variable is updated. // and that the index state variable is updated.
$help_search = \Drupal::service('plugin.manager.search')->createInstance('help_search'); $help_search = \Drupal::service('plugin.manager.search')->createInstance('help_search');
@ -156,15 +156,3 @@ function _help_search_update(array $extensions = []): void {
$help_search->updateIndexState(); $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;
}

View File

@ -57,7 +57,8 @@ class HelpSectionManager extends DefaultPluginManager {
*/ */
public function clearCachedDefinitions() { public function clearCachedDefinitions() {
parent::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 // 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 // and any changes due to help topics edits or translation changes are
// picked up. // picked up.