Updated: Comment #21

Problem/Motivation

The YAML keys for local tasks are longer than needed.

Proposed resolution

Make the grouping by route instead of plugin ID, and make the other keys simpler if possible.

Local tasks are provided by plugins implementing LocalTaskInterface instead of type MENU_LOCAL_TASK in hook_menu() https://drupal.org/node/2044515

says now:

user.login_tab:
  route_name: user.page
  title: 'Log in'
  tab_root_id: user.login_tab
user.new_password_tab:
  route_name: user.pass
  title: 'Request new password'
  tab_root_id: user.login_tab
user.new_register_tab:
  route_name: user.register
  title: 'Create new account'
  tab_root_id : user.login_tab
  weight: 10

adding an example:
core/modules/system/tests/modules/menu_test/menu_test.local_tasks.yml

 menu_test.tasks_default_tab:
   route_name: menu_test.tasks_default
   title: View
   tab_root_id: menu_test.tasks_default_tab
 menu_test.tasks_default_edit_tab:
   route_name: menu_test.tasks_default_edit
   title: Edit
   tab_root_id: menu_test.tasks_default_tab

Each local task is represented by a plugin. Each plugin definition (found in the $module.local_actions.yml file) contains three to five local-task specific keys underneath the top-level key which is the unique plugin ID. Pattern for the plugin ID is: module_name.whatever_you_want_that_does_not_have_a_dot

Keys are:
route_name: The machine name of the local task route - this also determines where it's displayed
title: The title of the local action. By default, it will be passed through t() and localized.
tab_root_id: The plugin ID of the "root" tab (generally the top, leftmost one) which serves to group a set of tabs.
tab_parent_id: (optional) The plugin ID of the tab that is the parent - only relevant for 2nd level tabs
weight:(optional) The integer weight (lower weight tabs are further left, default is 0).

after would it be:

user.login:
  route_name: user.page
  title: 'Log in'
  base_route: user.login
user.new_password:
  route_name: user.pass
  title: 'Request new password'
  base_route: user.login
user.register:
  title: 'Create new account'
  route_name: user.register
  base_route: user.login
  weight: 10

added example would be

 menu_test.tasks_default:
   title: View
   route_name: menu_test.tasks_default
   base_route: menu_test.tasks_default
 menu_test.tasks_default_edit:
   title: Edit
   route_name:  menu_test.tasks_default_edit
   base_route: menu_test.tasks_default

Each local task is represented by a plugin. Each plugin definition (found in the $module.local_actions.yml file) contains one to five local-task specific keys underneath the top-level key which is the unique plugin ID. Pattern for the plugin ID is: module_name.whatever_you_want_that_does_not_have_a_dot

It is recommended is to name the plugin the same as the route name or route_name + '.task' or '.tab'
route_name

Keys are:

  • route_name: The machine name of the local task route - this also determines where it's displayed.
  • title: The title of the local action. By default, it will be passed through t() and localized. Strings with spaces should use single quotes.
  • base_route: The route where the "root" tab (generally the top, leftmost one) is displayed and which serves to group a set of tabs.
  • parent_id (optional): The plugin ID of the tab that is the parent - only relevant for 2nd level tabs. If this is set, base_route should be omitted and will be supplied from the parent
  • weight: (optional) The integer weight (lower weight tabs are further left, default is 0).

Remaining tasks

User interface changes

none

API changes

local task definition changes

#2095117: Menu system should provide a default tab if none exists

CommentFileSizeAuthor
#74 interdiff.txt1.29 KBdawehner
#74 local_tasks-2107531.patch70.2 KBdawehner
#71 increment-2107531-68-71.txt6.39 KBpwolanin
#71 local-tasks-2107531-71.patch69.43 KBpwolanin
#69 interdiff.txt4.9 KBdawehner
#68 increment-2107531-64-68.txt7.04 KBpwolanin
#68 local-tasks-2107531-68.patch65.2 KBpwolanin
#65 increment-2107531-62-64.txt956 bytespwolanin
#65 local-tasks-2107531-64.patch60.19 KBpwolanin
#64 increment-2107531-60-62.txt1.65 KBpwolanin
#64 local-tasks-2107531-62.patch59.97 KBpwolanin
#62 increment-2107531-60-62.txt1.65 KBpwolanin
#62 local-tasks-2107531-62.patch59.97 KBpwolanin
#60 increment-2107531-55-60.txt11.16 KBpwolanin
#60 local-tasks-2107531-60.patch58.32 KBpwolanin
#56 increment-2107531-46-55.txt3.47 KBpwolanin
#56 local-tasks-2107531-55.patch50.61 KBpwolanin
#53 local-tasks-2107531-53.patch50.66 KBcilefen
#46 interdiff-local-tasks-2107531-41-46.txt820 bytescilefen
#46 local-tasks-2107531-46.patch49.7 KBcilefen
#41 interdiff-local-tasks-2107531-38-41.txt1.03 KBcilefen
#41 local-tasks-2107531-41.patch49.85 KBcilefen
#38 local-tasks-2107531-38.patch49.61 KBpwolanin
#22 local-tasks-2107531-22.patch19.85 KBYesCT
#22 interdiff-14-22.txt1.75 KBYesCT
#14 local-tasks-2107531-14.patch19.96 KBtim.plunkett
#14 interdiff.txt717 bytestim.plunkett
#12 drupal8.plugin-system.2107531-12.patch19.54 KBneclimdul
#8 interdiff.txt427 bytesneclimdul
#8 drupal8.plugin-system.2107531-8.patch19.44 KBneclimdul
#6 drupal8.plugin-system.2107531-6.patch19.45 KBneclimdul
#4 drupal8.menu-system.2102125-10.patch66.2 KBneclimdul
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

neclimdul’s picture

A longer post describing some of my thoughts leading to proposing this in IRC. http://www.nerdpalace.net/node/6

There are complications with the parent_id/grouping changes I'd suggested in that post that I've almost worked out but the rest is fairly easy to accomplish. I can post a patch with those changes shortly.

pwolanin’s picture

I think we could certainly improve the naming as suggested in that post, but I really don't like the idea of assuming the plugin ID is the the route name.

webchick’s picture

Tagging.

neclimdul’s picture

Status: Active » Needs review
FileSize
66.2 KB

Patch.

I don't think the assumption is as hidden or dangerously magical as is implied. route_name still exists and is usable and this validates that the guess is correct and throw an exception to notify developers. It is just a short hand for the common cases.

Status: Needs review » Needs work

The last submitted patch, drupal8.menu-system.2102125-10.patch, failed testing.

neclimdul’s picture

Status: Needs work » Needs review
FileSize
19.45 KB

wrong patch...

Status: Needs review » Needs work

The last submitted patch, drupal8.plugin-system.2107531-6.patch, failed testing.

neclimdul’s picture

Status: Needs work » Needs review
FileSize
19.44 KB
427 bytes

typo

Status: Needs review » Needs work
Issue tags: -DX (Developer Experience)

The last submitted patch, drupal8.plugin-system.2107531-8.patch, failed testing.

neclimdul’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
Issue tags: +DX (Developer Experience)

The last submitted patch, drupal8.plugin-system.2107531-8.patch, failed testing.

neclimdul’s picture

Status: Needs work » Needs review
FileSize
19.54 KB

just a reroll.

Status: Needs review » Needs work

The last submitted patch, drupal8.plugin-system.2107531-12.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review
FileSize
717 bytes
19.96 KB

Missed a spot. The other fail was HEAD being broken.

webchick’s picture

Issue tags: +8.x-alpha4

x

pwolanin’s picture

I think we should still convert the grouping to be by route, e..g. base_route

dawehner also suggests that if you have a parent_id we should automatically fill in this value for you from that of the parent.

neclimdul’s picture

I thought we decided those where separate issues.

YesCT’s picture

+++ b/core/modules/system/tests/modules/menu_test/menu_test.local_tasks.yml
@@ -1,73 +1,59 @@
-  tab_root_id: menu_test.tasks_default_tab
+  root_id: menu_test.tasks_default_tab
...
-  tab_root_id: menu_test.tasks_tasks_tab
+  root_id: menu_test.tasks_tasks_tab

most of the other changes remove the _tab postfix. should these (and a couple others) also do that?

YesCT’s picture

it might be helpful to update the issue summary and explain the difference between the root and parent id. along with any other info to update the summary.

dawehner’s picture

I would love to get the conversions in first.

YesCT’s picture

oh, root and parent are describe in the local tasks change notice. parent is for 2nd level tasks.

+++ b/core/modules/system/tests/modules/menu_test/menu_test.local_tasks.yml
@@ -1,73 +1,59 @@
 menu_test.tasks_default_tab:
   route_name: menu_test.tasks_default
   title: 'View'
-  tab_root_id: menu_test.tasks_default_tab
+  root_id: menu_test.tasks_default_tab

taking the pattern further we can take of _tab from the plugin_id.
then if the plugin id is the same as the route_name, we can remove the route_name.

Also, if it is itself the root, we can take off the root_id.

So... with the patch here, it would become

 menu_test.tasks_default:
   title: 'View'

and it magically knows to look for a route of the same name and that it is its own root.

Before, it was clear the root_id was the plugin_id for the local task and did not have to be named the same as the route.

issue title is:
Improve DX of local task YAML definitions

So, what will our instructions be for developers?
Local tasks are provided by plugins implementing LocalTaskInterface instead of type MENU_LOCAL_TASK in hook_menu() https://drupal.org/node/2044515
says now:

user.login_tab:
  route_name: user_page
  title: 'Log in'
  tab_root_id: user_login_tab
user.new_password_tab:
  route_name: user_pass
  title: 'Request new password'
  tab_root_id: user_login_tab
user.new_password_tab:
  route_name: user_register
  title: 'Create new account'
  tab_root_id : user_login_tab
  weight: 10

adding an example:
core/modules/system/tests/modules/menu_test/menu_test.local_tasks.yml

 menu_test.tasks_default_tab:
   route_name: menu_test.tasks_default
   title: View
   tab_root_id: menu_test.tasks_default_tab
 menu_test.tasks_default_edit_tab:
   route_name: menu_test.tasks_default_edit
   title: Edit
   tab_root_id: menu_test.tasks_default_tab
Each local task is represented by a plugin. Each plugin definition (found in the $module.local_actions.yml file) contains three to five loal-task specific keys underneath the top-level key which is the unique plugin ID. Pattern for the plugin ID is: module_name.whatever_you_want_that_does_not_have_a_dot

Keys are:
route_name: The machine name of the local task route - this also determines where it's displayed
title: The title of the local action. By default, it will be passed through t() and localized.
tab_root_id: The plugin ID of the "root" tab (generally the top, leftmost one) which serves to group a set of tabs.
tab_parent_id: (optional) The plugin ID of the tab that is the parent - only relevant for 2nd level tabs
weight:(optional) The integer weight (lower weight tabs are further left, default is 0).

after would it be:

user.login:
  route_name: user.page
  title: 'Log in'
  root_id: user_login
user.new_password:
  route_name: user.pass
  title: 'Request new password'
  root_id: user.login
user.new_password:
  route_name: user.register
  title: 'Create new account'
  root_id: user.login
  weight: 10

added example would be

 menu_test.tasks_default:
   title: View
 menu_test.tasks_default_edit:
   title: Edit
   root_id: menu_test.tasks_default
Each local task is represented by a plugin. Each plugin definition (found in the $module.local_actions.yml file) contains one to five local-task specific keys underneath the top-level key which is the unique plugin ID. Pattern for the plugin ID is: module_name.whatever_you_want_that_does_not_have_a_dot

It is recommended is to name the plugin the same as the route name:
route_name

Keys are:
route_name: The machine name of the local task route - this also determines where it's displayed. If the plugin ID is equal to the route name, the route_name is optional and if not specified, the route_name will be assumed to be the same as the plugin ID.
title: The title of the local action. By default, it will be passed through t() and localized. Strings with spaces should use single quotes.
root_id: The plugin ID of the "root" tab (generally the top, leftmost one) which serves to group a set of tabs. This is optional if it is the root.
parent_id (optional): The plugin ID of the tab that is the parent - only relevant for 2nd level tabs. Only needed if different than the root_id.
weight: (optional) The integer weight (lower weight tabs are further left, default is 0).

I'll put this is the issue summary so others can edit and correct it.

Note to self: I think class is a key missing from the list of three to five keys.

So, I'm not sure if this is 'Improving the DX' or 'shortening what they have to type'.

YesCT’s picture

Issue summary: View changes

before and after example added

YesCT’s picture

Issue summary: View changes

html

YesCT’s picture

Issue summary: View changes

html again

YesCT’s picture

Title: Improve DX of local task YAML definitions » Improve DX of local task YAML definitions by using the route_name string as the plugin ID and assuming route_name and root_id
Issue tags: -Needs issue summary update
FileSize
1.75 KB
19.85 KB

I'm not sure this is a good idea, but since I went through menu_test and applied the pattern to bits that were left out, here it is in case it is useful.

Status: Needs review » Needs work

The last submitted patch, local-tasks-2107531-22.patch, failed testing.

neclimdul’s picture

Before, it was clear the root_id was the plugin_id for the local task and did not have to be named the same as the route.

So, I'm not sure if this is 'Improving the DX' or 'shortening what they have to type'.

So, I think these are great statements describing the confusing I've seen around this patch.

So the developer experience literally is "what I have to type" so I don't see those as completely seperate. Also something less clear from touching up or reviewing is "what I have to remember and copy around" though in the future this will be the case for re-factoring.

I found that when making a set of local tasks the biggest process after finding the routes is this dance of copying things around or repeatedly typing out certain strings. Its really frustrating and it ends up with in the worst case 3 copies of the exact same string on a definition(this is true with the _tab only you've got to remember which one gets the suffix and which don't).

Anywhere in code where we have a pattern like this where we consistently are calling a function and copying the same thing into multiple parameters we would just provide a default behavior. We document this is how we expect to generally call this so this is how each argument will behave if the argument isn't provided. Everything is clear.

This however is actually more frustrating then code though because its manually typed strings rather then what would likely be repeated variables in code so its very error prone and has more maintenance debt in that you're going to have copy the string out all over the structure. The code example used by YesCT pretty clearly demonstrate this I think.

And I think YesCT did a pretty good idea of explaining what we tell developers as well.

pwolanin’s picture

Title: Improve DX of local task YAML definitions by using the route_name string as the plugin ID and assuming route_name and root_id » Improve DX of local task YAML definitions

good DX is NOT ONLY about what you have type the 1st time, it should also be about reducing the WTF factor when you come back to it 6 months later or are looking at it as a novice.

I think the magic proposed here is a bad idea and will make the DX overall worse. There is no reason to even want it unless you've just been converting 50 tasks, which is something we have to do once for core and never again. So, it's compelling to neclimdul for just that reason, but it should not go in as a general change.

I agree we could make the keys more concise, and I think we should redo the grouping based on route name rather than plugin ID.

pwolanin’s picture

If we are going to change to grouping by route, then there is no point to rename "tab_root_id" to something else since we are going to redefine it anyhow.

Part of the reason all those values are explicit now is that I decided when I wrote the initial patch for this that we should have them that way and that the excess magic of hook_menu should not be carried over here because it was horribly confusing for people to tease out what did what.

So, I think the change here should be limited to at most:
- changing "tab_parent_id" to "parent_id"
- copying by default the tab_root_id from the parent for tabs not at the top level.

tim.plunkett’s picture

Issue tags: -8.x-alpha4

Didn't make it :(

pwolanin’s picture

Now that the big conversion is in we can revisit this.

dawehner’s picture

So, I think the change here should be limited to at most:
- changing "tab_parent_id" to "parent_id"
- copying by default the tab_root_id from the parent for tabs not at the top level.

We could simplify it even a bit more. What about just having parent_id or parent_route_id (depends which one we want).
If parent_id == tab_parent_id, we are at the default local task case. If parent_id is a default local task, we are at level 0 but a sibling etc.

dawehner’s picture

Issue summary: View changes

remaining tasks

pwolanin’s picture

Issue summary: View changes
Issue tags: +beta blocker

tagging as beta bloker since I know improved DX is a big concern for webchick and others, and it would be unreasonable to change the YAML keys after beta.

xjm’s picture

Priority: Normal » Major

I swear there is a meta issue somewhere for "all the stuff that used to be defined with hook_menu()"... where?

Also, I'd consider this a major DX issue.

xjm’s picture

Gábor Hojtsy’s picture

Looks like we are still not close to figuring out how to improve DX of the tabs definitions or if any proposed improvement is actually an improvement or not. In practice, we now have the following structures in core:

some_route_id:
  tab_root_id: some_route_id
  route_name: some_route_id
  title: 'Some tab'

The plugin ID of the tab is not required to be the same as the route, but we adopted that as a common practice because otherwise it is free reign, people can use '_tab' after the route name, or replace dots with underscores or shorten things or whatnot and then all you end up with is a mess. I think its an improvement that we have clear guidelines for this. I'm not sure if that is even a possible use case that a route may serve different tabs at different places, so tying the two together with a best practice pattern sounds good to me.

As for then leaving them out if they are not different from each other and ending up with:

some_route_id:
  title: 'Some tab'

I don't have a strong feeling either way, but it is true that people do understand classes where not all properties of the object are on the constructor (and have defaults, sometimes computed). People also understand functions that have optional arguments, etc. I think its a good question how default values here would be different from those.

I think if we document / suggest the naming parity rule for the tab plugin ID and the route name, then repeated equal values will keep being common. If we don't document / suggest that, then the plugin IDs will be an inconsistent mess, and people need to wonder how to name them and find some other rule / suggestion anyway. That sounds like more work. So if we assume our best practice setup will have the same ID 2-3 times on it, the question remains if that is best for developers to understand and repeat their understanding of the inner workings of the system each time they write a tab definition.

pwolanin’s picture

I'll work on this soon.

as in #26 100% object to assuming the key is the route name, but taking the root from the parent is sensible and will cut down on errors.

Gábor Hojtsy’s picture

@pwolanin: would be good to have a list of simplifications that all parties support :) You just mentioned one here. Hope there is more, because taking the root from the parent sounds like not a major or beta blocker change(?)

pwolanin’s picture

So, starting on this, I realized a problem - if you want to group by route (e.g. base_route) you cannot take route parameters into account. In contrast, with the current API, you can potentially specify both the route and route parameters for the root tab.

In other words, the current system would allow you to define a group of tabs that appear e.g. on just a specific node or user.

Is that something we want or need to support? I don't think it's supported in Drupal 7.

And in fact, the current code just matches the route name (not parameter), so really it would be no change.

pwolanin’s picture

Status: Needs work » Needs review
FileSize
49.61 KB

This patch might have missed a couple things, but generally got most of the change

Status: Needs review » Needs work

The last submitted patch, 38: local-tasks-2107531-38.patch, failed testing.

Gábor Hojtsy’s picture

The base_route looks better then the tab_root_id to me. Is this the extent of changes proposed or just the first step?

cilefen’s picture

Status: Needs work » Needs review
FileSize
49.85 KB
1.03 KB
pwolanin’s picture

Thanks - looks like a step in the right direction.

I'm not sure about the logic of:

$base_routes[$task_info['parent_id']] = $task_info['parent_id'];

Does that correctly group sub-tabs?

The last submitted patch, 41: local-tasks-2107531-41.patch, failed testing.

cilefen’s picture

Probably not. base_route isn't set in many cases now so what are we trying to store in the base routes instead? Should it be:

$base_routes[$task_info['route_name']] = $task_info['parent_id'];

I don't really understand the issue enough to say any more about it.

pwolanin’s picture

I think you might be able to omit the elseif entirely - just skip those:

+            elseif(!empty($task_info['parent_id'])) {
+              $base_routes[$task_info['parent_id']] = $task_info['parent_id'];
+            }
cilefen’s picture

dawehner’s picture

+++ b/core/lib/Drupal/Core/Menu/LocalTaskManager.php
@@ -179,47 +179,54 @@ public function getLocalTasksForRoute($route_name) {
+            if(!empty($task_info['base_route'])) {
+              $base_routes[$task_info['base_route']] = $task_info['base_route'];
+            }
...
           if ($route_name == $task_info['route_name']) {
-            $tab_root_ids[$task_info['tab_root_id']] = $task_info['tab_root_id'];

I wonder whether we can introduce to auomatically add the base_route, if possible.

cilefen’s picture

Is parent_id supposed to be the base_route if base_route is not set?

pwolanin’s picture

@cilefen - the ID of each task might happen to be the same, BUT the ID is an arbitrary.

So, the logic I'm going for is that if parent_id is set, the base_route should be looked up from the parent using that ID.

@dawhener - I'm not sure what you mean - it should add it from the parent. Or you mean the idea of defining the tab on the base route by default? IF so, let's tackle that as a follow-up that this enables.

cilefen’s picture

@pwolanin: that is what I thought. If I am following this, that additional code should go right near the patch in #46, correct?

The last submitted patch, 46: local-tasks-2107531-46.patch, failed testing.

pwolanin’s picture

@cilefen - yes, the definitions are keyed by plugin ID, so you shoudl be able to set the base_route in the 1st loop.

cilefen’s picture

FileSize
50.66 KB

I have noticed that in cases where this conditional is used:

foreach ($definitions as $plugin_id => $task_info) {}

$plugin_id sometimes has parameters attached after a colon. So, you shouldn't try to test if the $route_name passed to the method is equal to $plugin_id. It is better to do this:

$route_name == $task_info['id']

This will certainly still fail, but I'd like to see how.

Status: Needs review » Needs work

The last submitted patch, 53: local-tasks-2107531-53.patch, failed testing.

The last submitted patch, 53: local-tasks-2107531-53.patch, failed testing.

pwolanin’s picture

Status: Needs work » Needs review
FileSize
50.61 KB
3.47 KB

Here's an increment relative to #46, including fix for a yaml conflict.

I think this fixes the missing sub-tabs.

The last submitted patch, 56: local-tasks-2107531-55.patch, failed testing.

The last submitted patch, 56: local-tasks-2107531-55.patch, failed testing.

dawehner’s picture

This patch is wonderful. It really improves the DX of local tasks while keeping the logic the same, now it just have to pass.

Sadly

+++ b/core/modules/field_ui/lib/Drupal/field_ui/Plugin/Derivative/FieldUiLocalTask.php
@@ -79,7 +79,7 @@ public function getDerivativeDefinitions(array $base_plugin_definition) {
-          'tab_root_id' => "field_ui.fields:overview_$entity_type",
+          'base_route' => "field_ui.overview_$entity_type",

This is wonderful <3 < 3

pwolanin’s picture

Ah, dawehner brilliantly saw the bug leading to the new fails - a PHP wtf with using a reference in the 1st foreach loop.

This also fixes some other tests and removes more code from ContentTranslationLocalTasks and ConfigTranslationLocalTasks

The last submitted patch, 60: local-tasks-2107531-60.patch, failed testing.

pwolanin’s picture

fixes a fatal in ContentTranslationLocalTasksTest since it was calling a method that had been removed.

The last submitted patch, 62: local-tasks-2107531-62.patch, failed testing.

pwolanin’s picture

ok, silly mistake - if we're not using the & reference we still need to update the array we are using in the top loop.

pwolanin’s picture

FileSize
60.19 KB
956 bytes

oops, posted the wrong patch

The last submitted patch, 64: local-tasks-2107531-62.patch, failed testing.

The last submitted patch, 65: local-tasks-2107531-64.patch, failed testing.

pwolanin’s picture

Some (hopefully) final fixes for various mistakes in local_tasks.yml files and test fixes.

dawehner’s picture

FileSize
4.9 KB
+++ b/core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php
@@ -193,33 +193,26 @@ public function providerTestGetWeight() {
-      // Ensure that a default tab of a derivative gets the default value.
-      array(
-        array(
-          'tab_root_id' => 'local_task_derivative_default:example_id',
-          'id' => 'local_task_derivative_default'
-        ),
-        'local_task_derivative_default:example_id',
-        -10,
-      ),

What is the reason for this hunk?

I went down and tried to remove that removal as well as add a new unit test for childs, so we know that the parent_id works,
though I have not managed to get it green.

pwolanin’s picture

@dawehner - that section didn't seems to be doing anything different from the 1st section - just testing that the default tab gets a -10 weight - there wasn't actually anything related to derivatives involved.

We should indeed add a little new testing around parent_id, and we need a longer-term follow-up to make more than 2 levels of tabs work correctly.

pwolanin’s picture

Extending dawehner's start in #69, this adds to the unit test so we verify the expected processing of child local tasks and tries to make the unit test code a little easier to maintain.

The last submitted patch, 71: local-tasks-2107531-71.patch, failed testing.

pwolanin’s picture

71: local-tasks-2107531-71.patch queued for re-testing.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
70.2 KB
1.29 KB

Extended the test coverage to 100% in the getLocalTasksForRoute method.

xjm’s picture

Priority: Major » Critical

Critical beta blocker.

webchick’s picture

Title: Improve DX of local task YAML definitions » Change notice + docs: Improve DX of local task YAML definitions
Priority: Critical » Major
Status: Reviewed & tested by the community » Active
Issue tags: +Needs change record, +Needs documentation

Wow, this patch is absolutely just full of win. Great job. Also nice job on the issue summary, it was super easy to tell what was going on.

Committed and pushed to 8.x. Thanks! We need to update the existing change notices and documentation under https://drupal.org/node/2122071 now.

pwolanin’s picture

Issue summary: View changes
pwolanin’s picture

Title: Change notice + docs: Improve DX of local task YAML definitions » Change notice and docs: Improve DX of local task YAML definitions
pwolanin’s picture

Title: Change notice and docs: Improve DX of local task YAML definitions » docs need update: Improve DX of local task YAML definitions
Issue summary: View changes
Issue tags: -Needs change record
dawehner’s picture

Status: Active » Reviewed & tested by the community

nice!

pwolanin’s picture

Title: docs need update: Improve DX of local task YAML definitions » Improve DX of local task YAML definitions
Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs documentation

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

YesCT’s picture

In the change record, we wrote:
"Note in particular that by defining a base_route, it's simpler to discover how to associate a tab, rather than having to find a plugin ID."

I'm not sure why we said that. Don't we look up the route id in the same place that we would have looked up the plugin id?