Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#4 | 3065079-workbench_access-access-interface-docs.patch | 8.03 KB | agentrickard |
Comments
Comment #2
agentrickardMight be legacy from D7 not having a good sort API? I really don't recall.
Comment #3
agentrickardI 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."
Comment #4
agentrickardCleans up documentation (and logically groups the methods) for AccessControlHierarchyInterface.
Comment #6
agentrickardCommitted.