diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index 489f301..240c585 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -18,7 +18,6 @@ use Drupal\taxonomy\Entity\Vocabulary; use Drupal\taxonomy\VocabularyInterface; use Drupal\Component\Utility\String; -use Symfony\Cmf\Component\Routing\RouteObjectInterface; /** * Denotes that no term in the vocabulary has a parent. @@ -130,9 +129,9 @@ function taxonomy_term_uri($term) { * Implements hook_page_build(). */ function taxonomy_page_build(&$page) { - $request = \Drupal::request(); - if ($request->attributes->get(RouteObjectInterface::ROUTE_NAME) == 'taxonomy.term_page') { - $term = $request->attributes->get('taxonomy_term'); + $route_match = \Drupal::routeMatch(); + if ($route_match->getRouteName() == 'taxonomy.term_page') { + $term = $route_match->getParameter('taxonomy_term'); foreach ($term->uriRelationships() as $rel) { // Set the term path as the canonical URL to prevent duplicate content. $page['#attached']['drupal_add_html_head_link'][] = array(