Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 300000

Use Context system for actions

$
0
0

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.

  1. The 'type' parameter of action annotations is replaced by a proper context definition.
  2. The execute() method on ActionConfigEntityInterface is removed.
  3. 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


Viewing all articles
Browse latest Browse all 300000

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>