You are here

protected function ProximityFilter::valueSubmit in Geolocation Field 8.3

Same name and namespace in other branches
  1. 8.2 src/Plugin/views/filter/ProximityFilter.php \Drupal\geolocation\Plugin\views\filter\ProximityFilter::valueSubmit()

Perform any necessary changes to the form values prior to storage. There is no need for this function to actually store the data.

Overrides FilterPluginBase::valueSubmit

File

src/Plugin/views/filter/ProximityFilter.php, line 144

Class

ProximityFilter
Filter handler for search keywords.

Namespace

Drupal\geolocation\Plugin\views\filter

Code

protected function valueSubmit($form, FormStateInterface $form_state) {
  $value = $form_state
    ->getValue([
    'options',
    'value',
    'value',
  ]);
  $distance = (double) $value;
  $form_state
    ->setValue([
    'options',
    'value',
    'value',
  ], $distance);
  $form_state
    ->setValue([
    'options',
    'value',
    'center',
  ], $form_state
    ->getValue([
    'options',
    'value',
    'center',
  ], []));
  parent::valueSubmit($form, $form_state);
}