Change record status: 
Introduced in branch: 

This change record has been updated based on

As a part of the new New Symfony-based routing system, the action link definitions are moving out of hook_menu() and into plugins implementing \Drupal\Core\Menu\LocalActionInterface. The primary discovery mechanism is YAML files following the naming pattern

A default implementation \Drupal\Core\Menu\LocalActionDefault is used unless another class is specified in the YAML file.

Drupal 7

function contact_menu() {
$items['admin/structure/contact'] = array(
'title' => 'Contact form',
'description' => 'Create a system contact form and set up categories for the form to use.',
'page callback' => 'contact_category_list',
'access arguments' => array('administer contact forms'),
'file' => '',
$items['admin/structure/contact/add'] = array(
'title' => 'Add category',
'page callback' => 'drupal_get_form',
'page arguments' => array('contact_category_edit_form'),
'access arguments' => array('administer contact forms'),
'weight' => 1,
'file' => '',

Drupal 8

Local actions are defined in a YAML format, named after the module they are defined by ($modulename.links.action.yml). See Providing module-defined actions.

Yaml File

  route_name: contact_category_add
  title: 'Add category'
    - contact_category_list

Each local action is represented by a plugin with a definition from the YAML. Each local action definition contains four keys:
id: The machine name of the pluing
route_name: The machine name of the local action route.
title: The title of the local action. Will be passed on to t().
title_context: Optional context to pass on with the title to t().
appears_on: An array of route names for this action to be display on.

In order for a local action to be converted, both it and the path it appears on must first be converted to routes.
See #1971384: [META] Convert page callbacks to controllers for the list of issues and the WSCCI Conversion guide for instructions.

Note that the MENU_LOCAL_ACTION type did more than just present it as a local action, it also manipulated the breadcrumb trail and controlled which tabs appeared on its page. In order to preserve that behavior, a new constant was introduced, MENU_SIBLING_LOCAL_TASK.

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 updates done