ConfigTranslationDeleteForm::submitForm

public ConfigTranslationDeleteForm::submitForm(array &$form, FormStateInterface $form_state)

Form submission 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 FormInterface::submitForm

File

core/modules/config_translation/src/Form/ConfigTranslationDeleteForm.php, line 132

Class

ConfigTranslationDeleteForm
Builds a form to delete configuration translation.

Namespace

Drupal\config_translation\Form

Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
public function submitForm(array &$form, FormStateInterface $form_state) {
  foreach ($this->mapper->getConfigNames() as $name) {
    $this->languageManager->getLanguageConfigOverride($this->language->getId(), $name)->delete();
  }
 
  // Flush all persistent caches.
  $this->moduleHandler->invokeAll('cache_flush');
  foreach (Cache::getBins() as $cache_backend) {
    $cache_backend->deleteAll();
  }
 
  drupal_set_message($this->t('@language translation of %label was deleted', array('%label' => $this->mapper->getTitle(), '@language' => $this->language->getName())));
 
  $form_state->setRedirectUrl($this->getCancelUrl());
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.