Updated: Comment #1

Problem/Motivation

Routes now uses $module.foo as the route names, so to be more consistent use the same kind of pattern for local actions.

Proposed resolution

use the route name + ".action" as each ID. Keeping the ID distinct from the route name will help avoid mistaken assumptions (especially in tests).

Before

custom_block_type_add:
   route_name: custom_block.type_add
   title: 'Add custom block type'
   appears_on:
     - custom_block.type_list

After 1 (the one in the last patch)

custom_block.type_add.action:
   route_name: custom_block.type_add
   title: 'Add custom block type'
   appears_on:
     - custom_block.type_list

After 2

custom_block.type_add:
   route_name: custom_block.type_add
   title: 'Add custom block type'
   appears_on:
     - custom_block.type_list

After 3

-
   plugin_id: custom_block.type_add
   route_name: custom_block.type_add
   title: 'Add custom block type'
   appears_on:
     - custom_block.type_list

Remaining tasks

User interface changes

API changes

#2095613: Convert all plugin IDs in local_tasks.yml to 'module_name.foo_bar' naming convention to match routing convention

Comments

pwolanin’s picture

Title: Adapt $module.foo pattern for local action/local task plugin IDs » Adapt $module.foo pattern for local action plugin IDs
mr.baileys’s picture

Status: Active » Needs review
Issue tags: +DX (Developer Experience)
FileSize
3.24 KB
FAILED: [[SimpleTest]]: [MySQL] 59,861 pass(es), 4 fail(s), and 2 exception(s). View

First stab. Only replaced the underscore between module and foo with a period (.), there is still some inconsistency left in the local actions names (some have the suffix "_local_action", others "_action" or no suffix. Should that also be changed as part of this issue?

mr.baileys’s picture

Issue summary: View changes

Updated issue summary.

dawehner’s picture

The last submitted patch, 2: 2091145-2-local-actions-yml.patch, failed testing.

dawehner’s picture

Issue summary: View changes
FileSize
3.18 KB
PASSED: [[SimpleTest]]: [MySQL] 59,941 pass(es). View
3.08 KB

This should work

pwolanin’s picture

I'd like to keep _action or .action on them - I think having too many thinks named the same as the route by chance is going to be confusing and lead to mistakes & bugs in the future.

pwolanin’s picture

Issue summary: View changes
FileSize
4.38 KB
PASSED: [[SimpleTest]]: [MySQL] 60,056 pass(es). View
4.32 KB

Adds ".action" to each ID

dawehner’s picture

-1

pwolanin’s picture

@dawehner - I really feel using the same name as the route everywhere is going to lead to subtle bugs and mistakes in contrib.

Why not append something distinct?

dawehner’s picture

Issue summary: View changes
pwolanin’s picture

Would it be helpful to also add a comment in the YAML, like:

forum.add_forum.action: # The plugin ID
  route_name: forum.add_forum
  title: 'Add forum'
  appears_on:
    - forum.overview

forum.add_container.action: # The plugin ID
  route_name: forum.add_container
  title: 'Add container'
  appears_on:
    - forum.overview
pwolanin’s picture

FileSize
4.8 KB
PASSED: [[SimpleTest]]: [MySQL] 63,026 pass(es). View
4.85 KB

This adds the comment to all the IDs, and also fixes the views_ui one to have "views_ui" not "views" as the prefix.

pwolanin’s picture

15: local_action-2091145-13.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 15: local_action-2091145-13.patch, failed testing.

The last submitted patch, 15: local_action-2091145-13.patch, failed testing.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.