You are here

search_api_attachments_field_collections.install in Search API attachments 7

Module install file.

File

contrib/search_api_attachments_field_collections/search_api_attachments_field_collections.install
View source
<?php

/**
 * @file
 * Module install file.
 */

/**
 * Set excluded_private to FALSE for existing websites to preserve behavior.
 */
function search_api_attachments_field_collections_update_7100() {
  $search_api_indexes = db_select('search_api_index')
    ->fields('search_api_index', array(
    'machine_name',
  ))
    ->execute()
    ->fetchCol();
  $indexes = search_api_index_load_multiple($search_api_indexes);
  if (!empty($indexes)) {
    foreach ($indexes as $index) {
      if (isset($index->options['data_alter_callbacks']['search_api_attachments_field_collections_alter_settings']) && isset($index->options['data_alter_callbacks']['search_api_attachments_field_collections_alter_settings']['settings'])) {
        $index->options['data_alter_callbacks']['search_api_attachments_field_collections_alter_settings']['settings']['excluded_private'] = 0;
        entity_save('search_api_index', $index);
      }
    }
  }
}

Functions

Namesort descending Description
search_api_attachments_field_collections_update_7100 Set excluded_private to FALSE for existing websites to preserve behavior.