I've just noticed that
hook_node_presave($node) is fired twice when adding new nodes: Once it's called from
node_form_submit(); the second time from
It turns out that
$node->nid is not set in first call, but it is already present in the second one.
Is this a normal behavior for
hook_node_presave($node) in Drupal 7? Does the node containing node reference fields make a difference?