You are here

public function BoundaryFilter::validateExposed in Geolocation Field 8

Validate the exposed handler form

Overrides HandlerBase::validateExposed

File

src/Plugin/views/filter/BoundaryFilter.php, line 229

Class

BoundaryFilter
Filter handler for search keywords.

Namespace

Drupal\geolocation\Plugin\views\filter

Code

public function validateExposed(&$form, FormStateInterface $form_state) {
  parent::validateExposed($form, $form_state);
  if ($this->options['expose']['input_by_geocoding_widget'] && !empty($this->options['expose']['geocoder_plugin_settings']['plugin_id'])) {
    $geocoder_configuration = $this->options['expose']['geocoder_plugin_settings']['settings'];

    /** @var \Drupal\geolocation\GeocoderInterface $geocoder_plugin */
    $geocoder_plugin = $this->geolocationCore
      ->getGeocoderManager()
      ->getGeocoder($this->options['expose']['geocoder_plugin_settings']['plugin_id'], $geocoder_configuration);
    if (!empty($geocoder_plugin)) {
      $geocoder_plugin
        ->formvalidateInput($form_state);
    }
  }
}