Looks like we introduced a small bug in #2050919: Replace local task plugin discovery with YamlDiscovery.

The default weight should be NULL not 0, so that the plugin can determine whether it's set in the definition, or if it needs a default.

The main use case is that that \Drupal\Core\Menu\LocalTaskDefault sets the weight to -10 for the root tab so it automatically appears on the left.

Files: 
CommentFileSizeAuthor
#4 2087007-4-PASS.patch1.44 KBpwolanin
PASSED: [[SimpleTest]]: [MySQL] 59,251 pass(es).
[ View ]
#3 2087007-3-FAIL.patch618 bytespwolanin
FAILED: [[SimpleTest]]: [MySQL] 59,280 pass(es), 3 fail(s), and 0 exception(s).
[ View ]
#3 2087007-3-PASS.patch1.44 KBpwolanin
PASSED: [[SimpleTest]]: [MySQL] 59,237 pass(es).
[ View ]
#1 2087007-1.patch857 bytespwolanin
PASSED: [[SimpleTest]]: [MySQL] 59,357 pass(es).
[ View ]

Comments

Status:Active» Needs review
Issue tags:+MenuSystemRevamp
StatusFileSize
new857 bytes
PASSED: [[SimpleTest]]: [MySQL] 59,357 pass(es).
[ View ]

Also teaks the a doc line so it's < 80 chars and a little clearer.

I guess some test to ensure that would be great.

Priority:Minor» Normal
StatusFileSize
new1.44 KB
PASSED: [[SimpleTest]]: [MySQL] 59,237 pass(es).
[ View ]
new618 bytes
FAILED: [[SimpleTest]]: [MySQL] 59,280 pass(es), 3 fail(s), and 0 exception(s).
[ View ]

looks like a task weight was tweaked at some point to make the tests pass but hid the bug.

The test code in LocalTasksTest itself says:

// The Edit task defines no weight, which is expected to sort as 0.

so clearly it was wrong to set it to 10.

Attached is the test change alone, plus in combination with #1 (modulo a 1 letter doc change).

StatusFileSize
new1.44 KB
PASSED: [[SimpleTest]]: [MySQL] 59,251 pass(es).
[ View ]

idk why this is taking hours to run - just re-posting the same patch.

Status:Needs review» Reviewed & tested by the community

Ok, seems pretty straight forward to me.

Eclipse

Status:Reviewed & tested by the community» Fixed

Committed and pushed to 8.x. Thanks!

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