Chris@0: getSourceLangcode($form_state)) { Chris@0: $entity = $form_state->getFormObject()->getEntity(); Chris@0: // We need a redirect here, otherwise we would get an access denied page, Chris@0: // since the current URL would be preserved and we would try to add a Chris@0: // translation for a language that already has a translation. Chris@18: $form_state->setRedirectUrl($entity->toUrl('edit-form')); Chris@0: } Chris@0: } Chris@0: Chris@0: }