You are here

public function FieldLayoutEntityDisplayFormTrait::validateForm in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/field_layout/src/Form/FieldLayoutEntityDisplayFormTrait.php \Drupal\field_layout\Form\FieldLayoutEntityDisplayFormTrait::validateForm()
  2. 9 core/modules/field_layout/src/Form/FieldLayoutEntityDisplayFormTrait.php \Drupal\field_layout\Form\FieldLayoutEntityDisplayFormTrait::validateForm()

Overrides \Drupal\field_ui\Form\EntityDisplayFormBase::validateForm().

File

core/modules/field_layout/src/Form/FieldLayoutEntityDisplayFormTrait.php, line 145

Class

FieldLayoutEntityDisplayFormTrait
Provides shared code for entity display forms.

Namespace

Drupal\field_layout\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  parent::validateForm($form, $form_state);
  $layout_plugin = $this
    ->getLayout($this
    ->getEntity(), $form_state);
  if ($layout_plugin instanceof PluginFormInterface) {
    $subform_state = SubformState::createForSubform($form['field_layouts']['settings_wrapper']['layout_settings'], $form, $form_state);
    $layout_plugin
      ->validateConfigurationForm($form['field_layouts']['settings_wrapper']['layout_settings'], $subform_state);
  }
}