function FieldConfigEditForm::submitForm

Same name in other branches
  1. 8.9.x core/modules/field_ui/src/Form/FieldConfigEditForm.php \Drupal\field_ui\Form\FieldConfigEditForm::submitForm()
  2. 10 core/modules/field_ui/src/Form/FieldConfigEditForm.php \Drupal\field_ui\Form\FieldConfigEditForm::submitForm()
  3. 11.x core/modules/field_ui/src/Form/FieldConfigEditForm.php \Drupal\field_ui\Form\FieldConfigEditForm::submitForm()

Overrides EntityForm::submitForm

File

core/modules/field_ui/src/Form/FieldConfigEditForm.php, line 189

Class

FieldConfigEditForm
Provides a form for the field settings form.

Namespace

Drupal\field_ui\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
    parent::submitForm($form, $form_state);
    // Handle the default value.
    $default_value = [];
    if (isset($form['default_value'])) {
        $items = $form['#entity']->get($this->entity
            ->getName());
        $default_value = $items->defaultValuesFormSubmit($form['default_value'], $form, $form_state);
    }
    $this->entity
        ->setDefaultValue($default_value);
}

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