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
A lot of different places could use operation links like edit/delete/clone/enable... of a certain entity,
for example the listing of entities, maybe REST or views but it is currently tied to using the listing controller.
Proposed resolution
Let's move the list of operations to the actual entity so it's easier to use for other people.
Remaining tasks
-
Comments
Comment #1
Berdir+1 :)
- We should try to make it extendable, then e.g. translation_entity.module can add "add translation" operations
- Wondering how to handle permissions, sounds like we either need to pass in an $account object or define access callbacks.
Comment #2
dawehnerOne generel thing i'm wondering about: How many of these informations
should be duplicated, because many things (like the title, the access callback) sort
of already exists on the hook_menu level. In theory we could pull the information out of hook_menu or the other way round, though the first one really feels ugly.
One approach for extendability would be a simple hook based approach,
similar to the way hook_links works (urgs another similar solution for the same problem).
Another way could be fancy event subscribe/event listener thing, but this seems to be much more of a d8 content.
Comment #3
dawehner#1696660: Add an entity access API for single entity access would some have to get in first.
Comment #4
fagoI think that's a duplicate of #1839516: Introduce entity operation providers.
Comment #16
quietone CreditAttribution: quietone at PreviousNext commentedPretty sure this is outdated.