You are here

public function OverviewFilterForm::validateForm in MongoDB 8.2

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

modules/mongodb_watchdog/src/Form/OverviewFilterForm.php, line 166

Class

OverviewFilterForm
Provides the MongoDB Watchdog overview filter form.

Namespace

Drupal\mongodb_watchdog\Form

Code

public function validateForm(array &$form, FormStateInterface $formState) : void {
  if ($formState
    ->isValueEmpty('type') && $formState
    ->isValueEmpty('severity')) {
    $formState
      ->setErrorByName('type', $this
      ->t('You must select something to filter by.'));
  }
}