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

Title:Adapt $module.foo pattern for local action/local task plugin IDsAdapt $module.foo pattern for local action plugin IDs

Status:Active» Needs review
Issue tags:+DX (Developer Experience)
StatusFileSize
new3.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?

Issue summary:View changes

Updated issue summary.

2: 2091145-2-local-actions-yml.patch queued for re-testing.

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

Issue summary:View changes
StatusFileSize
new3.18 KB
PASSED: [[SimpleTest]]: [MySQL] 59,941 pass(es).
[ View ]
new3.08 KB

This should work

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.

Issue summary:View changes
StatusFileSize
new4.38 KB
PASSED: [[SimpleTest]]: [MySQL] 60,056 pass(es).
[ View ]
new4.32 KB

Adds ".action" to each ID

-1

@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?

Issue summary:View changes

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

StatusFileSize
new4.8 KB
PASSED: [[SimpleTest]]: [MySQL] 63,026 pass(es).
[ View ]
new4.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.

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.