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.
This is a spin off from #1008166-39: Actions should be a module where @rootatwc proposed the removal of $object parameter from actions_do(). As he stated there
It doesn't make any sense, having it there, it just make everything more confusing. The caller of actions_do should make sure that the node, comment or user object is inside the context variable, so it can be used in token_replace.
Unless we want to make this more general and also pass the $entity_type of the object in actions_do and actions_do supply it as an argument in the context, which is pointless imo.
This issue is to discuss the wisdom of that proposal and to implement such a refactoring in the "new" actions module code.
Comments
Comment #1
sunComment #2
ParisLiakos CreditAttribution: ParisLiakos commentedAfter taking a closer look, seems we have the $entity_type from hook_action_info
type
parameter.So instead of doing stuff like that:
actions_do
should definitely do that before calling the action callback.I still think entity parameter should be removed
Comment #9
andypostRules made own implementation of that context argument, Please file new issue if there's reason to do that still
Comment #10
andypost