You are here

function acquia_search_preprocess_status_messages in Acquia Connector 8

Disable Search API Solr Warning/Error messages regarding EOL.

Parameters

$variables:

File

acquia_search/acquia_search.module, line 709
Integration between Acquia Drupal and Acquia's hosted solr search service.

Code

function acquia_search_preprocess_status_messages(&$variables) {
  $current_path = \Drupal::service('path.current')
    ->getPath();
  if (strpos((string) $current_path, "admin/config/search/search-api") == TRUE) {
    if (isset($variables['message_list'])) {
      foreach ($variables['message_list'] as $msg_type => $messages) {
        foreach ($messages as $message_key => $message) {
          if (strpos((string) $message, "Search API Solr 8.x-1.x") !== FALSE) {
            unset($variables['message_list'][$msg_type][$message_key]);
          }
          if (empty($variables['message_list'][$msg_type])) {
            unset($variables['message_list'][$msg_type]);
          }
        }
      }
    }
  }
}