In trigger module, not all actions are available for all triggers, because some actions do not make sense in certain contexts. For example, you wouldn’t run the “Promote post to front page” action with the trigger “After deleting a post.”

but when I installed the workflow module all action became available for all triggers!

Comments

marashi’s picture

I found this function on line 1466 of workflow.module:

/**
 * Implementation of action_info_alter().
 */
function workflow_action_info_alter(&$info) {
  foreach (array_keys($info) as $key) {
    // Modify each action's hooks declaration, changing it to say
    // that the action supports any hook.
    $info[$key]['hooks']['any'] = TRUE;
  }
}

it makes that issue! what does it for?!

jvandyk’s picture

Status: Active » Closed (works as designed)

In workflow 5.x, people didn't like that actions weren't available because they didn't understand contexts*. So the triggerunlock module did that. Then people didn't like that triggerunlock was required. So the triggerunlock functionality was rolled into workflow. So now we have this issue that doesn't like that actions are made available. We've come full circle. Comment out workflow_action_info_alter() and you get what you want.

*and the context code is not the best; I blame myself.