From 537a479d72eb94c03b1007018b7919bb856c4402 Mon Sep 17 00:00:00 2001 From: Maria Fisher Date: Tue, 23 Nov 2021 14:03:54 -0800 Subject: [PATCH 1/2] Issue #327 adding translation to the url. --- modules/wri_taxonomy/wri_taxonomy.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/wri_taxonomy/wri_taxonomy.module b/modules/wri_taxonomy/wri_taxonomy.module index edd374f4f..89854c7e6 100644 --- a/modules/wri_taxonomy/wri_taxonomy.module +++ b/modules/wri_taxonomy/wri_taxonomy.module @@ -50,7 +50,7 @@ function wri_taxonomy_entity_type_alter(array &$entity_types) { */ function wri_taxonomy_term_uri(TermInterface $term) { if ($term->field_landing_page && $term->field_landing_page->isEmpty() === FALSE && isset($term->field_landing_page->entity)) { - return $term->field_landing_page->entity->toUrl(); + return $term->field_landing_page->entity->toUrl('canonical', ['language' => $term->language()]); } if (!empty(\Drupal::hasService('wri_search.pretty_facets_helper'))) { From 1f759dc7b4879486faa13dc26fa735cb3e2f7967 Mon Sep 17 00:00:00 2001 From: Maria Fisher Date: Tue, 23 Nov 2021 14:11:52 -0800 Subject: [PATCH 2/2] Issue #327 also translate pages that point to the resource library. --- modules/wri_taxonomy/wri_taxonomy.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/wri_taxonomy/wri_taxonomy.module b/modules/wri_taxonomy/wri_taxonomy.module index 89854c7e6..6412e0df0 100644 --- a/modules/wri_taxonomy/wri_taxonomy.module +++ b/modules/wri_taxonomy/wri_taxonomy.module @@ -99,7 +99,7 @@ function wri_taxonomy_term_uri(TermInterface $term) { if (isset($filter_by)) { $paths_helper = \Drupal::service('wri_search.pretty_facets_helper'); if ($paths_helper) { - return Url::fromUri('internal:/resources' . $paths_helper->getPrettyPaths($filter_by)); + return Url::fromUri('internal:/resources' . $paths_helper->getPrettyPaths($filter_by), ['language' => $term->language()]); } } }