function VocabularyResetForm::submitForm
Same name in other branches
- 9 core/modules/taxonomy/src/Form/VocabularyResetForm.php \Drupal\taxonomy\Form\VocabularyResetForm::submitForm()
- 10 core/modules/taxonomy/src/Form/VocabularyResetForm.php \Drupal\taxonomy\Form\VocabularyResetForm::submitForm()
- 11.x core/modules/taxonomy/src/Form/VocabularyResetForm.php \Drupal\taxonomy\Form\VocabularyResetForm::submitForm()
Overrides EntityForm::submitForm
File
-
core/
modules/ taxonomy/ src/ Form/ VocabularyResetForm.php, line 81
Class
- VocabularyResetForm
- Provides confirmation form for resetting a vocabulary to alphabetical order.
Namespace
Drupal\taxonomy\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
parent::submitForm($form, $form_state);
$this->termStorage
->resetWeights($this->entity
->id());
$this->messenger()
->addStatus($this->t('Reset vocabulary %name to alphabetical order.', [
'%name' => $this->entity
->label(),
]));
$this->logger('taxonomy')
->notice('Reset vocabulary %name to alphabetical order.', [
'%name' => $this->entity
->label(),
]);
$form_state->setRedirectUrl($this->getCancelUrl());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.