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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pwolanin’s picture

Status: Active » Needs review
Issue tags: +MenuSystemRevamp
FileSize
857 bytes

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

dawehner’s picture

I guess some test to ensure that would be great.

pwolanin’s picture

Priority: Minor » Normal
FileSize
1.44 KB
618 bytes

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).

pwolanin’s picture

FileSize
1.44 KB

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

EclipseGc’s picture

Status: Needs review » Reviewed & tested by the community

Ok, seems pretty straight forward to me.

Eclipse

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

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