You are here

public function MediaTypeForm::validateForm in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/media/src/MediaTypeForm.php \Drupal\media\MediaTypeForm::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

core/modules/media/src/MediaTypeForm.php, line 282

Class

MediaTypeForm
Form controller for media type forms.

Namespace

Drupal\media

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  parent::validateForm($form, $form_state);
  if (isset($form['source_dependent']['source_configuration'])) {

    // Let the selected plugin validate its settings.
    $this->entity
      ->getSource()
      ->validateConfigurationForm($form['source_dependent']['source_configuration'], $this
      ->getSourceSubFormState($form, $form_state));
  }
}