You are here

public function GeofieldProximityField::validateOptionsForm in Geofield 8

Validate the options form.

Overrides PluginBase::validateOptionsForm

File

src/Plugin/views/field/GeofieldProximityField.php, line 116

Class

GeofieldProximityField
Field handler to render a Geofield proximity in Views.

Namespace

Drupal\geofield\Plugin\views\field

Code

public function validateOptionsForm(&$form, FormStateInterface $form_state) {
  parent::validateOptionsForm($form, $form_state);
  try {
    $this->sourcePlugin
      ->validateOptionsForm($form['source_configuration'], $form_state, [
      'source_configuration',
    ]);
  } catch (\Exception $e) {
    watchdog_exception('geofield', $e);
    $form_state
      ->setErrorByName($form['source'], $this
      ->t("The Proximity Source couldn't be set due to: @error", [
      '@error' => $e,
    ]));
  }
}