public function VocabularyFormController::languageConfigurationSubmit

Submit handler to update the bundle for the default language configuration.

File

drupal/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyFormController.php, line 137
Definition of Drupal\taxonomy\VocabularyFormController.

Class

VocabularyFormController
Base form controller for vocabulary edit forms.

Namespace

Drupal\taxonomy

Code

public function languageConfigurationSubmit(array &$form, array &$form_state) {
  $vocabulary = $this
    ->getEntity($form_state);

  // Delete the old language settings for the vocabulary, if the machine name
  // is changed.
  if ($vocabulary && isset($vocabulary->machine_name) && $vocabulary->machine_name != $form_state['values']['machine_name']) {
    language_clear_default_configuration('taxonomy_term', $vocabulary->machine_name);
  }

  // Since the machine name is not known yet, and it can be changed anytime,
  // we have to also update the bundle property for the default language
  // configuration in order to have the correct bundle value.
  $form_state['language']['default_language']['bundle'] = $form_state['values']['machine_name'];
}