You are here

public function SearchApiRangesAlter::configurationFormValidate in Search API ranges 7

Implements SearchApiAlterCallbackInterface::configurationFormValidate().

Overrides SearchApiAbstractAlterCallback::configurationFormValidate

File

includes/callback_search_api_ranges.inc, line 62

Class

SearchApiRangesAlter
Search API ranges data alteration callback that indexes the min and max of selected numeric fields.

Code

public function configurationFormValidate(array $form, array &$values, array &$form_state) {

  // Make the index believe that the status of the callback has changed to
  // force Search API to take in account our properties.
  // We can't do that in the submit because it's happening too late.
  if ($form_state['values']['callbacks']['search_api_ranges_alter']['status'] == 1) {
    if ($this->index->options['data_alter_callbacks']['search_api_ranges_alter']['status'] == 1) {
      $form_state['index']->options['data_alter_callbacks']['search_api_ranges_alter']['status'] = 0;
    }
  }
}