You are here

public function BulkForm::viewsFormValidate in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/views/field/BulkForm.php \Drupal\views\Plugin\views\field\BulkForm::viewsFormValidate()
  2. 10 core/modules/views/src/Plugin/views/field/BulkForm.php \Drupal\views\Plugin\views\field\BulkForm::viewsFormValidate()

File

core/modules/views/src/Plugin/views/field/BulkForm.php, line 467

Class

BulkForm
Defines a actions-based bulk operation form element.

Namespace

Drupal\views\Plugin\views\field

Code

public function viewsFormValidate(&$form, FormStateInterface $form_state) {
  $ids = $form_state
    ->getValue($this->options['id']);
  if (empty($ids) || empty(array_filter($ids))) {
    $form_state
      ->setErrorByName('', $this
      ->emptySelectedMessage());
  }
}