Commit 6229f147 authored by Tim Diels's avatar Tim Diels Committed by Anton Ivanov
Browse files

Issue #3196796 by tim-diels: Illegal choice Changed in Sort on element

parent 12dd2bed
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -123,8 +123,10 @@ class SimpleSearchForm extends FormBase {
  protected function setupSearchApiAutocomplete(array &$form, array $config) {
    $autocomplete_config = $config['search_api_autocomplete'];

    if (!empty($autocomplete_config['arguments'])) {
      $arguments = explode(',', $autocomplete_config['arguments']);
      $arguments = array_map('trim', $arguments);
    }

    // Setup search_api_autocomplete field type, see
    // \Drupal\search_api_autocomplete\Utility\AutocompleteHelper
@@ -133,8 +135,12 @@ class SimpleSearchForm extends FormBase {
    $form[$config['get_parameter']]['#additional_data'] = [
      'filter' => $autocomplete_config['filter'],
      'display' => $autocomplete_config['display'],
      'arguments' => $arguments,
    ];

    // Only pass the arguments when we have them configured.
    if (isset($arguments)) {
      $form[$config['get_parameter']]['#additional_data']['arguments'] = $arguments;
    }
  }

}