function tripal_core_modules_enabled

2.x tripal_core.search.inc tripal_core_modules_enabled($modules)
3.x tripal_core.search.inc tripal_core_modules_enabled($modules)

Implements hook_modules_enabled().

This hook is called when ANY module is enabled. This allows us to update the the search api "Default node index" when any Tripal module is enabled thus allowing us to catch new node types right after they're created.

File

tripal_core/includes/tripal_core.search.inc, line 340
Adds support for Drupal indexing of Chado. It's important to note that not all of Chado is indexed but instead Only fields indicated in hook_search_include_chado_fields().

Code

function tripal_core_modules_enabled($modules) {
  if (module_exists('search_api')) {
    $index_enabled = db_query('SELECT enabled FROM search_api_index WHERE machine_name=:name', array(':name' => 'default_node_index'))->fetchField();
    if ($index_enabled) {
      tripal_search_update_default_index();
    }
  }
}