Problem/Motivation

All the access hierarchy plugins return a 'weight' entry in the tree items, but its not documented what this is for.
\Drupal\workbench_access\Controller\WorkbenchAccessSections doesn't sort the tree by weight and implementations like the Menu plugin do their own sorting.
Is sorting required?
Is the 'weight' entry required?

Proposed resolution

Decide on the exact details of the return of ::getTree and update the documentation on the method.
Decide if WBA should handle sorting for the plugins.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

larowlan created an issue. See original summary.

agentrickard’s picture

Might be legacy from D7 not having a good sort API? I really don't recall.

agentrickard’s picture

I remember now:

In the D7 version, we created a custom form element instead of using the native Field API one. The weight attribute allowed the proper sorting of elements (as did the now-unused 'depth' parameter).

These can likely be removed, but documentation of them would be "In case you want to create your own field widgets or user interfaces, these values allow for proper nesting and sorting of values."

agentrickard’s picture

Status: Active » Needs review
FileSize
8.03 KB

Cleans up documentation (and logically groups the methods) for AccessControlHierarchyInterface.

  • agentrickard committed d0f8f4e on 8.x-1.x
    Issue #3065079 by agentrickard: Document what 'weight' is for in the...
agentrickard’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

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