I have used this function hook_node_insert()
, but it does not help me because this hook runs before the node is actually saved in the database. I am indexing nodes to a third party application whenever a node is inserted, updated or deleted. The application sends request to the node URL, but using hook_node_insert()
. It's giving me an invalid document location error because the node is not actually inserted yet.
Is there any hook invoked after a node is saved or updated in the database?
I followed this approach, without success.
function my_module_node_insert($node) {
if (!$node->type == 'article' || !$node->type == 'page') {
return;
}
my_module_do_index($node);
}