function _search_api_search_module_warning in Search API 8
Returns a warning message if the Core Search module is enabled.
Return value
string|null A warning message if needed, NULL otherwise.
See also
search_api_install()
2 calls to _search_api_search_module_warning()
- search_api_help in ./
search_api.module - Implements hook_help().
- search_api_requirements in ./
search_api.install - Implements hook_requirements().
File
- ./
search_api.module, line 544 - Provides a rich framework for creating searches.
Code
function _search_api_search_module_warning() {
if (\Drupal::moduleHandler()
->moduleExists('search')) {
$args = [
':url' => Url::fromRoute('system.modules_uninstall')
->toString(),
':documentation' => 'https://www.drupal.org/docs/8/modules/search-api/getting-started/common-pitfalls#core-search',
];
return t('The default Drupal core Search module is still enabled. If you are using Search API, you probably want to <a href=":url">uninstall</a> the Search module for performance reasons. For more information see <a href=":documentation">the Search API handbook</a>.', $args);
}
return NULL;
}