You are here

public function FormModeManagerDisplayEditForm::submitForm in Form mode manager 8.2

Same name and namespace in other branches
  1. 8 src/Form/FormModeManagerDisplayEditForm.php \Drupal\form_mode_manager\Form\FormModeManagerDisplayEditForm::submitForm()

Add more precise cache/routes invalidation when we are sure these, form-mode as added/deleted onto entities.

Overrides EntityDisplayFormBase::submitForm

File

src/Form/FormModeManagerDisplayEditForm.php, line 83

Class

FormModeManagerDisplayEditForm
Form Mode Manager enhancements for edit form of the EntityFormDisplay.

Namespace

Drupal\form_mode_manager\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  if ($this
    ->isDefaultForm() && $this
    ->formModesUpdated($form, $form_state)) {
    $this->cacheTagsInvalidator
      ->invalidateTags([
      'local_action',
      'local_tasks',
      'entity_types',
      'rendered',
    ]);
    $this->routeBuilder
      ->rebuild();
  }
}