function SearchHelpHooks::searchUpdate
Ensure that search is updated when extensions are installed or uninstalled.
Parameters
string[] $extensions: (optional) If modules are being uninstalled, the names of the modules being uninstalled. For themes being installed/uninstalled, or modules being installed, omit this parameter.
File
-
core/
modules/ search/ modules/ search_help/ src/ Hook/ SearchHelpHooks.php, line 71
Class
- SearchHelpHooks
- Hook implementations for help.
Namespace
Drupal\search_help\HookCode
protected function searchUpdate(array $extensions = []) : void {
// Early return if we're uninstalling this module.
if (in_array('search_help', $extensions)) {
return;
}
// Ensure that topics for extensions that have been uninstalled are removed
// and that the index state variable is updated.
$help_search = $this->searchManager
->createInstance('help_search');
$help_search->updateTopicList();
$help_search->updateIndexState();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.