In the trigger module's trigger_assign_form(), the following code is run:

  // Restrict the options list to actions that declare support for this hook-op
  // combination.
  foreach (actions_list() as $func => $metadata) {
    if (isset($metadata['hooks']['any']) || (isset($metadata['hooks'][$hook]) && is_array($metadata['hooks'][$hook]) && (in_array($op, $metadata['hooks'][$hook])))) {
      $functions[] = $func;
    }
  }

actions_list() calls hook_action_info() and hook_action_info_alter() in succession.

workflow's hook_action_info_alter() is:

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';
  }
}

Which just doesn't seem to mesh with what trigger_assign_form() is looking for.

It looks as if workflow should actually be setting something like this:

$info[$key]['hooks']['any'] = TRUE;

For example, node_action_info() defines:

    'node_assign_owner_action' => array(
      'type' => 'node',
      'description' => t('Change the author of a post'),
      'configurable' => TRUE,
      'behavior' => array('changes_node_property'),
      'hooks' => array(
        'any' => TRUE,
        'nodeapi' => array('presave'),
        'comment' => array('delete', 'insert', 'update'),
      ),
    ),

And in fact, those are the only two instances of the quoted string "any" in Drupal 6 core, so I don't think I'm missing anything?

Patch attached.

CommentFileSizeAuthor
workflow.module.patch414 bytesjweowu

Comments

heltem’s picture

Version: 6.x-1.1 » 6.x-1.3

Same issue here.
I agree with this patch.

jvandyk’s picture

Status: Needs review » Fixed

Fixed in 6.x-1.x-dev. There is no difference in functionality since isset($metadata['hooks']['any'] evaluates to TRUE either way.

heltem’s picture

Difference is for modules which try to do an array_merge() with the 'any' string (which fails) instead of the expected associated array.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.