Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

The Drupal 8 breadcrumb is not based on active trail, by default, so getting and setting the active trail no longer has any effect on Drupal and menu_get_active_trail() is not used anywhere except in test code.

This change removes functions:

menu_set_active_item($path)
menu_set_active_trail($new_trail = NULL)
menu_get_active_trail()
menu_link_get_preferred($path = NULL, $selected_menu = NULL)

Drupal 7.x:


  $active_trail = menu_get_active_trail();

Drupal 8.x:
If you need to find the menu link IDs in the active trail use \Drupal\Core\Menu\MenuActiveTrail::getActiveTrailIds(), via the 'menu.active_trail' service


  $ids = \Drupal::service('menu.active_trail')->getActiveTrailIds($menu_name);

If you need the active link use this instead of menu_link_get_preferred($path = NULL, $selected_menu = NULL)


 $link = \Drupal::service('menu.active_trail')->getActiveLink($menu_name);

There is no way to set the active link - override the service if you need more control.

Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done