function HelpSectionManager::clearCachedDefinitions

Same name in other branches
  1. 9 core/modules/help_topics/src/HelpSectionManager.php \Drupal\help_topics\HelpSectionManager::clearCachedDefinitions()
  2. 10 core/modules/help/src/HelpSectionManager.php \Drupal\help\HelpSectionManager::clearCachedDefinitions()
  3. 11.x core/modules/help/src/HelpSectionManager.php \Drupal\help\HelpSectionManager::clearCachedDefinitions()

Overrides DefaultPluginManager::clearCachedDefinitions

File

core/modules/help_topics/src/HelpSectionManager.php, line 38

Class

HelpSectionManager
Decorates the Help Section plugin manager to provide help topic search.

Namespace

Drupal\help_topics

Code

public function clearCachedDefinitions() {
    parent::clearCachedDefinitions();
    if ($this->searchManager && $this->searchManager
        ->hasDefinition('help_search') && $this->moduleHandler
        ->moduleExists('help_topics')) {
        // 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.
        $help_search = $this->searchManager
            ->createInstance('help_search');
        $help_search->markForReindex();
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.