How come this works

function mymodule_action_info_alter(&$info) {
// Make the "Block current user" action available to the
// comment insert trigger. If other modules have modified the
// array already, we don't stomp on their changes; we just make sure
// the 'insert' operation is present. Otherwise, we assign the
// 'insert' operation.
if (isset($info['user_block_user_action']['hooks']['comment'])) {
array_merge($info['user_block_user_action']['hooks']['comment'],
array('insert'));
}
else {
$info['user_block_user_action']['hooks']['comment'] = array('insert');
}
}

And this doesn't

function mymodule_action_info_alter1(&$info) {
// Make the "Send email action" action available to the
// comment insert trigger. If other modules have modified the
// array already, we don't stomp on their changes; we just make sure
// the 'insert' operation is present. Otherwise, we assign the
// 'insert' operation.
if (isset($info['system_send_email_action']['hooks']['comment'])) {
array_merge($info['system_send_email_action']['hooks']['comment'],
array('insert'));
}
else {
$info['system_send_email_action']['hooks']['comment'] = array('insert');
}
}

Comments

gleble’s picture

I've put both alterations in the same function now. The system_send_email_action bit still doesn't work. HELP

function beep_action_info_alter(&$info) {
// Make the "Block current user" action available to the
// comment insert trigger. If other modules have modified the
// array already, we don't stomp on their changes; we just make sure
// the 'insert' operation is present. Otherwise, we assign the
// 'insert' operation.
if (isset($info['user_block_user_action']['hooks']['comment'])) {
array_merge($info['user_block_user_action']['hooks']['comment'],
array('insert'));
}
else {
$info['user_block_user_action']['hooks']['comment'] = array('insert');
}
if (isset($info['system_send_email_action']['hooks']['comment'])) {
array_merge($info['system_send_email_action']['hooks']['comment'],
array('insert'));
print_r ($info [comment]);
}
else {
$info['system_send_email_action']['hooks']['comment'] = array('insert');
}
}
gleble’s picture

Running Ubuntu Hardy. Drupal is on my own server Is that any help? Please help me.