diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index 81537b6..4be6e7e 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -458,8 +458,8 @@ function template_preprocess_taxonomy_term(&$variables) { * A taxonomy term entity. */ function taxonomy_term_is_page(Term $term) { - $page_term = menu_get_object('taxonomy_term', 2); - return (!empty($page_term) ? $page_term->id() == $term->id() : FALSE); + $page_term = \Drupal::request()->attributes->get('taxonomy_term'); + return (is_object($page_term) && $page_term instanceof Term ? $page_term->id() == $term->id() : FALSE); } /**