You are here

function search_api_solr_help in Search API Solr 8

Same name and namespace in other branches
  1. 8.3 search_api_solr.module \search_api_solr_help()
  2. 8.2 search_api_solr.module \search_api_solr_help()
  3. 7 search_api_solr.module \search_api_solr_help()
  4. 4.x search_api_solr.module \search_api_solr_help()

Implements hook_help().

File

./search_api_solr.module, line 18
Provides a Solr-based service class for the Search API.

Code

function search_api_solr_help($route_name, RouteMatchInterface $route_match) {
  if ($route_name == 'search_api.overview') {

    // Included because we need the REQUIREMENT_* constants.
    include_once DRUPAL_ROOT . '/core/includes/install.inc';
    module_load_include('install', 'search_api_solr');
    $reqs = search_api_solr_requirements('runtime');
    foreach ($reqs as $req) {
      if (isset($req['description'])) {
        $type = $req['severity'] == REQUIREMENT_ERROR ? 'error' : ($req['severity'] == REQUIREMENT_WARNING ? 'warning' : 'status');
        \Drupal::messenger()
          ->addMessage($req['description'], $type);
      }
    }
  }
}