You are here

public function AbstractSearchApiSolrMultilingualBackend::submitConfigurationForm in Search API Multilingual Solr Search 8

File

src/Plugin/search_api/backend/AbstractSearchApiSolrMultilingualBackend.php, line 113

Class

AbstractSearchApiSolrMultilingualBackend
A abstract base class for all multilingual Solr Search API backends.

Namespace

Drupal\search_api_solr_multilingual\Plugin\search_api\backend

Code

public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
  $values = $form_state
    ->getValues();

  // 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.)
  foreach ($values['multilingual'] as $key => $value) {
    $form_state
      ->setValue($key, $value);
  }

  // Clean-up the form to avoid redundant entries in the stored configuration.
  $form_state
    ->unsetValue('multilingual');
  parent::submitConfigurationForm($form, $form_state);
}