public function WebformBulkFormBase::validateForm in Webform 6.x
Same name and namespace in other branches
- 8.5 src/Form/WebformBulkFormBase.php \Drupal\webform\Form\WebformBulkFormBase::validateForm()
Form validation handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides FormBase::validateForm
File
- src/
Form/ WebformBulkFormBase.php, line 105
Class
- WebformBulkFormBase
- Provides the webform bulk form base.
Namespace
Drupal\webform\FormCode
public function validateForm(array &$form, FormStateInterface $form_state) {
$action = $form_state
->getValue('action');
if (empty($action)) {
$form_state
->setErrorByName(NULL, $this
->t('No operation selected.'));
}
$entity_ids = array_filter($form_state
->getValue('items'));
if (empty($entity_ids)) {
$form_state
->setErrorByName(NULL, $this
->t('No items selected.'));
}
}