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
Comment #2
sklein121 commentedHey,
I'm doing something similar. This might be a noob question - but where do you stick this code? inside of a custom module?
Thanks
Comment #3
Anonymous (not verified) commentedYes, the code goes into a module named "module_name" e.g.
sites/all/modules/module_name/module_name.module.Comment #4
Anonymous (not verified) commentedIs support still needed for this issue?
Comment #5
Anonymous (not verified) commentedWell since I switched all my sites to drupal 7 half a year ago and in v7 it works as expected, I guess not. ;-)
Comment #6
Anonymous (not verified) commentedOk, thanks, going to close this out.