You are here

public function AjaxHistory::validateOptionsForm in Views AJAX History 8

Validate the options form.

Overrides DisplayExtenderPluginBase::validateOptionsForm

File

src/Plugin/views/display_extender/AjaxHistory.php, line 45

Class

AjaxHistory
Ajax history display extender plugin.

Namespace

Drupal\views_ajax_history\Plugin\views\display_extender

Code

public function validateOptionsForm(&$form, FormStateInterface $form_state) {
  if ($form_state
    ->hasValue('use_ajax') && $form_state
    ->getValue('use_ajax') != TRUE) {

    // Prevent use ajax history when ajax for view are disabled.
    $form_state
      ->setValue('enable_history', FALSE);
  }
}