I have defined a custom trigger like this:

function module_name_hook_hook_info() {
  return array(
    'module_name' => array(
      'module_name' => array(
        'foo' => array(
          'runs when' => t('Blabla.'),
        ),
      ),
    ),
  );
}

function module_name_module_name($op, $user) {
  if (!in_array($op, array('foo'))) {
    return; // Jump out if operation is not supported.
  }
  $action_ids = _trigger_get_hook_aids('module_name', $op);
  $context = array(
    'hook' => 'module_name',
    'op' => $op,
    'user' => $user,
  );
  actions_do(array_keys($action_ids), $user, $context);
}

From my code I fire it at the apropriate location using module_invoke_all('module_name', 'foo', $user);.

But when I visit /admin/build/trigger it only shows comment, node, cron, taxonomy and user not module_name. I've searched the site and the web exhaustively but don't get any clue (I did find the hook_menu_alter tip and used it but it did not work.). Implementing a custom action type for the trigger also led to no success although the action did show up in /admin/settings/actions.

Any ideas?

Comments

sklein121’s picture

Hey,

I'm doing something similar. This might be a noob question - but where do you stick this code? inside of a custom module?

Thanks

Anonymous’s picture

Yes, the code goes into a module named "module_name" e.g. sites/all/modules/module_name/module_name.module.

Anonymous’s picture

Status: Active » Postponed (maintainer needs more info)

Is support still needed for this issue?

Anonymous’s picture

Well since I switched all my sites to drupal 7 half a year ago and in v7 it works as expected, I guess not. ;-)

Anonymous’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Ok, thanks, going to close this out.