I am using menu_get_object() in my module hook_nodeapi function. Due to that code I get the following error:
Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection
without sending any data.
The code is as follows:
function mymodule_nodeapi(&$node, $op, $a3, $a4){
$nodex = menu_get_object();
drupal_set_message("Currnet Node(test) : {$nodex->nid}");
}
How can I resolve this problem?
I think it’s because
$nodeis passed in by reference to thehook_nodeapi()function and you’re trying to re-assign it usingmenu_get_object().You should either use a different name for the second node you want to load, e.g.
Or, if you’re looking for the node to which the
nodeapifunction is referring to, just use the$nodeobject passed into the function.UPDATE
I think this will do what you’re trying to do: