function FieldLayoutEntityDisplayFormTrait::validateForm

Same name in other branches
  1. 8.9.x core/modules/field_layout/src/Form/FieldLayoutEntityDisplayFormTrait.php \Drupal\field_layout\Form\FieldLayoutEntityDisplayFormTrait::validateForm()
  2. 10 core/modules/field_layout/src/Form/FieldLayoutEntityDisplayFormTrait.php \Drupal\field_layout\Form\FieldLayoutEntityDisplayFormTrait::validateForm()
  3. 11.x 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);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.