You are here

public function BulkForm::viewsFormValidate in Drupal 9

Same name and namespace in other branches
  1. 8 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 447

Class

BulkForm
Defines an 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());
  }
}