X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Ftaxonomy%2Fsrc%2FTermTranslationHandler.php;fp=web%2Fcore%2Fmodules%2Ftaxonomy%2Fsrc%2FTermTranslationHandler.php;h=688c63e38bdd9f65ab5dfc40a5c082038447030e;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/core/modules/taxonomy/src/TermTranslationHandler.php b/web/core/modules/taxonomy/src/TermTranslationHandler.php new file mode 100644 index 000000000..688c63e38 --- /dev/null +++ b/web/core/modules/taxonomy/src/TermTranslationHandler.php @@ -0,0 +1,39 @@ +getSourceLangcode($form_state)) { + $entity = $form_state->getFormObject()->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->setRedirectUrl($entity->urlInfo('edit-form')); + } + } + +}