You are here

public function ImportConfigForm::validateForm in Entity Share 8.3

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/entity_share_client/src/Form/ImportConfigForm.php, line 237

Class

ImportConfigForm
Entity form of the import config entity.

Namespace

Drupal\entity_share_client\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  parent::validateForm($form, $form_state);
  $values = $form_state
    ->getValues();
  $processors = $this
    ->getAllProcessors();

  // Iterate over all processors that have a form and are enabled.
  foreach (array_keys(array_filter($values['status'])) as $processor_id) {
    $processor = $processors[$processor_id];
    if ($processor instanceof PluginFormInterface) {
      $processor_form_state = SubformState::createForSubform($form['settings'][$processor_id], $form, $form_state);
      $processor
        ->validateConfigurationForm($form['settings'][$processor_id], $processor_form_state);
    }
  }
}