function BulkForm::viewsFormValidate

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/field/BulkForm.php \Drupal\views\Plugin\views\field\BulkForm::viewsFormValidate()
  2. 8.9.x core/modules/views/src/Plugin/views/field/BulkForm.php \Drupal\views\Plugin\views\field\BulkForm::viewsFormValidate()
  3. 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 483

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());
    }
    $action = $form_state->getValue('action');
    if (empty($action)) {
        $form_state->setErrorByName('', $this->emptyActionMessage());
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.