Overrides Drupal\Core\Entity\EntityFormController::save().
Overrides EntityFormController::save
public function save(array $form, array &$form_state) {
$vocabulary = $this->entity;
// Prevent leading and trailing spaces in vocabulary names.
$vocabulary->name = trim($vocabulary->name);
switch ($vocabulary
->save()) {
case SAVED_NEW:
drupal_set_message(t('Created new vocabulary %name.', array(
'%name' => $vocabulary->name,
)));
watchdog('taxonomy', 'Created new vocabulary %name.', array(
'%name' => $vocabulary->name,
), WATCHDOG_NOTICE, l(t('edit'), 'admin/structure/taxonomy/manage/' . $vocabulary
->id() . '/edit'));
$form_state['redirect'] = 'admin/structure/taxonomy/manage/' . $vocabulary
->id();
break;
case SAVED_UPDATED:
drupal_set_message(t('Updated vocabulary %name.', array(
'%name' => $vocabulary->name,
)));
watchdog('taxonomy', 'Updated vocabulary %name.', array(
'%name' => $vocabulary->name,
), WATCHDOG_NOTICE, l(t('edit'), 'admin/structure/taxonomy/manage/' . $vocabulary
->id() . '/edit'));
$form_state['redirect'] = 'admin/structure/taxonomy';
break;
}
$form_state['values']['vid'] = $vocabulary
->id();
$form_state['vid'] = $vocabulary
->id();
}