Hello ,

I want a "email" option to be available in "admin/content/node" page so that I could email the selected node content to a group of users . I tried to use hook_node_operations() for the purpose .
the following is my code

function email_node_operations()
{
$operations.=array(
email=>array(
'label'=> t('Email the node content');
callback => 'email_nodeid';
));
return $operations;
}

I get the following error when I try to enable the module
"Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 57 bytes) in /home/kartik/www/drupal-6.14/includes/common.inc on line 2823"

Please help

Comments

kar2905’s picture

My code is :

function email_node_operations()
{
$operations = array(
'email'=>array(
'label'=> t('Email the node content'),
'callback' => 'email_nodeid',
),
);
return $operations;

}

It is not working .

bobzibub’s picture

Does email_nodeid call email_node_operations()?
Something is calling it too many times right?

kar2905’s picture

No ..
I have still not defined email_nodeid .
For now , I am just trying to create a option in the page .

jaypan’s picture

Is your module named 'email'?

Contact me to contract me for D7 -> D10/11 migrations.

kar2905’s picture

Yes , it is named email

jaypan’s picture

You may need to create the callback function before it is recognized then. Try clearing your cache as well - there is a good chance that this hook isn't called every time that page is loaded.

Contact me to contract me for D7 -> D10/11 migrations.

kar2905’s picture

Is it neccesary to create the callback also ?
I will try as you suggested .

Is the code alright ?

Thanks for the information

kar2905’s picture

No , its different from what I want ..

kar2905’s picture

I got the option there . Thanks for the help .

It sends the nodeid of the nodes selected automatically to the calling function .
But in my case , I have to redirect it to a new page and send the node by GET option( appending in the url )
How do I do that ?

jaypan’s picture

What was the problem? How did you fix it?

Contact me to contract me for D7 -> D10/11 migrations.

kar2905’s picture

As you had said , I need to create the callback function also . Then it worked .
But now also the function does not work . The option is displayed though nothing happens when you click on it .
Pls help

kar2905’s picture

I did this and the problem got fixed .

$items['node/%/emailnode'] = array(
'title' => 'Send Email ',
'page callback' => 'emailnode_display_users',
'page arguments' => array(1), // <- nodeID (from % in node path)
'access arguments' => array('administer users'),
'type' => MENU_LOCAL_TASK,
);