db_update doesn't work with my code Whith a custom module, I'd like to update some nodes uid whenever a content type is updated.
I triple checked, and my database update function is called, as "changed" field is updated each time, and I send myself a mail to check that the data passed is correct.

I don't know how to call the equivalent of mysql_query() or die(), and don't manage to debug that. 

I have only a notice: 


  Undefined index: #language dans locale_field_node_form_submit().


function zen_custom_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  global $user;
  switch($form_id){
    case 'lieux_de_pratique_node_form':
      if (in_array('Admin dojos', array_values($user-&gt;roles))) {
        // some stuff
        $form['#submit'][]='set_dojos_manager';
        // ...
      }
      // ...
  }
  // ...
}

function set_dojos_manager($form, &amp;$form_state) { 
  $dojo_editeur = $form['field_dojo_editeur_web']['und'][0]['uid']['#default_value'];
  $dojo = $form['nid']['#value'];
  $uid_updated = db_update('node')
    -&gt;fields(array(
      'uid' =&gt; $dojo_editeur,
    ))
    -&gt;condition('nid', $dojo)
    -&gt;execute();

    mail('my_email', 'test', $dojo_editeur . ' / ' . $dojo);
  }
}
Your form submission handler should take the submitted values from $form_state['values'], not $form. The node object is then available in $form_state['node'].  

For such task it would be better to implement hook_node_presave(), which is called right before a node is saved.