Commit 06b9f300 authored by webchick's avatar webchick

Issue #2095971 by ekes: Remove instances of menu_get_object()('taxonomy_term()').

parent b584ef7b
......@@ -458,8 +458,12 @@ 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);
$request = \Drupal::request();
if ($request->attributes->has('taxonomy_term')) {
$page_term = $request->attributes->get('taxonomy_term');
return $page_term->id() == $term->id();
}
return FALSE;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment