public function Eva::validateOptionsForm in EVA: Entity Views Attachment 8
Same name and namespace in other branches
- 8.2 src/Plugin/views/display/Eva.php \Drupal\eva\Plugin\views\display\Eva::validateOptionsForm()
Validate the options form.
Overrides DisplayPluginBase::validateOptionsForm
File
- src/Plugin/ views/ display/ Eva.php, line 188 
Class
- Eva
- The plugin that handles an EVA display in views.
Namespace
Drupal\eva\Plugin\views\displayCode
public function validateOptionsForm(&$form, FormStateInterface $form_state) {
  parent::validateOptionsForm($form, $form_state);
  switch ($form_state
    ->get('section')) {
    case 'entity_type':
      if (empty($form_state
        ->getValue('entity_type'))) {
        $form_state
          ->setError($form['entity_type'], $this
          ->t('Must select an entity'));
      }
      break;
  }
}