You are here

public function SearchApiAlterCommentAccess::configurationFormSubmit in Search API 7

Overrides SearchApiAlterNodeAccess::configurationFormSubmit().

Doesn't index the comment's "Author".

Overrides SearchApiAlterNodeAccess::configurationFormSubmit

File

includes/callback_comment_access.inc, line 35
Contains the SearchApiAlterCommentAccess class.

Class

SearchApiAlterCommentAccess
Adds node access information to comment indexes.

Code

public function configurationFormSubmit(array $form, array &$values, array &$form_state) {
  $old_status = !empty($form_state['index']->options['data_alter_callbacks']['search_api_alter_comment_access']['status']);
  $new_status = !empty($form_state['values']['callbacks']['search_api_alter_comment_access']['status']);
  if (!$old_status && $new_status) {
    $form_state['index']->options['fields']['status']['type'] = 'boolean';
  }
  return parent::configurationFormSubmit($form, $values, $form_state);
}