Why the system enter two times in an hook_node_presave? I've write a simple module for my sites, where I populate a node reference by code.

I use hook_node_presave, but I notice that drupal enters TWO times in this hook, so if my node reference field is multiple, it populates it two times.

Is there something wrong on my code or is normal?
In the presave hook I've to load another node and then save it

I have something like this:

   function alterator_node_presave($node) {
      if ($node-&gt;type == 'partner_progetto') {
        // here I load a node "progetto" 
        // that is referenced on my partner_progetto node
        $progetto = node_load($node-&gt;field_progetto_rif['und'][0]['nid']);

        // here I load another node "soggetto" 
        // that is referenced on my partner_progetto node
        $soggetto = node_load($node-&gt;field_soggetto['und'][0]['nid']);

        // then I've to fill a node_reference in the node $progetto, 
        // using the nid of $soggetto
        $progetto-&gt;field_soggetto_ref['und'][]['nid'] = $soggetto-&gt;nid;

        node_save($progetto);   
      } 
   }


In this hook the system enter 2 times, so when I save a "partner progetto" node that has a reference to the node soggetto with nid '150' I've that the "progetto" node has this structure:

$progetto-&gt;field_soggetto_ref
  ['und']
    [0]['nid'] = 150,
    [1]['nid'] = 150;


The value of this field is filled two times.
Remove node_save($progetto); from alterator_node_presave and try. Because hook_node_presave is called just before the node_save. It can be reason of saving the field twice.