function ProfileTranslationController::entityFormSave

Form submission handler for ProfileTranslationController::entityFormAlter().

This handles the save action.

See also

\Drupal\Core\Entity\EntityFormController::build().

File

drupal/core/modules/user/lib/Drupal/user/ProfileTranslationController.php, line 33
Definition of Drupal\user\ProfileTranslationController.

Class

ProfileTranslationController
Defines the translation controller class for terms.

Namespace

Drupal\user

Code

function entityFormSave(array $form, array &$form_state) {
  if ($this
    ->getSourceLangcode($form_state)) {
    $entity = translation_entity_form_controller($form_state)
      ->getEntity();

    // We need a redirect here, otherwise we would get an access denied page
    // since the current URL would be preserved and we would try to add a
    // translation for a language that already has a translation.
    $form_state['redirect'] = $this
      ->getViewPath($entity);
  }
}