You are here

public function WebformHandlerFormBase::validateForm in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Form/WebformHandlerFormBase.php \Drupal\webform\Form\WebformHandlerFormBase::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/WebformHandlerFormBase.php, line 298

Class

WebformHandlerFormBase
Provides a base webform for webform handlers.

Namespace

Drupal\webform\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {

  // The webform handler configuration is stored in the 'settings' key in
  // the webform, pass that through for validation.
  $subform_state = SubformState::createForSubform($form['settings'], $form, $form_state);
  $this->webformHandler
    ->validateConfigurationForm($form, $subform_state);

  // Process handler state webform errors.
  $this
    ->processHandlerFormErrors($subform_state, $form_state);

  // Update the original webform values.
  $form_state
    ->setValue('settings', $subform_state
    ->getValues());
}