Problems
- Having a single parameter for actions is not sufficient, nor is it possible to add further metadata to the single parameter (e.g. to define whether it is required)
- We need to support actions without an entity paramter.
- Actions should follow the same API as conditions if there are no reasons to do it different.
- The action subsystem is coupled to entities.
- Finally, this is required if the action system should be useful to Rules as well.
Proposed resolution
Make the action sub-system using context, such as conditions.
Remaining tasks
Patch review.
User interface changes
-
API changes
API changes in this issue are approved by the comments on ActionInterface.php.
- The 'type' parameter of action annotations is replaced by a proper context definition.
- The execute() method on ActionConfigEntityInterface is removed.
- The executeMultiple() method signature on ActionInterface is changed to additionally take a context name argument as first parameter.
Original report by tim.plunkett
See #1846172: Replace the actions API, it currently passes entities around directly, and uses hardcoded type = node