You are here

public function SearchApiSolrService::configurationFormSubmit in Search API Solr 7

Implements SearchApiServiceInterface::__construct().

The default implementation just ensures that additional elements in $options, not present in the form, don't get lost at the update.

Overrides SearchApiAbstractService::configurationFormSubmit

File

includes/service.inc, line 342

Class

SearchApiSolrService
Search service class using Solr server.

Code

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

  // Since the form is nested into another, we can't simply use #parents for
  // doing this array restructuring magic. (At least not without creating an
  // unnecessary dependency on internal implementation.)
  $values += $values['http'];
  $values += $values['advanced'];
  $values += !empty($values['autocomplete']) ? $values['autocomplete'] : array();
  unset($values['http'], $values['advanced'], $values['autocomplete']);

  // Highlighting retrieved data only makes sense when we retrieve data.
  $values['highlight_data'] &= $values['retrieve_data'];

  // For password fields, there is no default value, they're empty by default.
  // Therefore we ignore empty submissions if the user didn't change either.
  if ($values['http_pass'] === '' && isset($this->options['http_user']) && $values['http_user'] === $this->options['http_user']) {
    $values['http_pass'] = $this->options['http_pass'];
  }
  parent::configurationFormSubmit($form, $values, $form_state);
}