update a node field when flagging I want to achieve the following : 
I have a node 'proposal' with a flag 'accept' and another node 'project'.
I want when a user flag the 'proposal' with the 'accept' flag, a field value in the 'project' node is updated.
I wrote this code but it seems not to work

function mymodule_flag_flag($flag, $entity_id, $account, $flagging)
{   

$node =  node_load($entity_id);
$freelancer = $node-&gt; uid;
$project_node = node_load($node-&gt;field_projet['und'][0]['target_id']);
$wrapper = entity_metadate_wrapper('node', $project_node);
$wrapper-&gt;field_freelancer-&gt;value = $freelancer;
}
I do not see that you are saving the project node, after changing field value.

function mymodule_flag_flag($flag, $entity_id, $account, $flagging) {     
  $node =  node_load($entity_id);
  $freelancer = $node-&gt; uid;
  $project_node = node_load($node-&gt;field_projet['und'][0]['target_id']);
  $wrapper = entity_metadate_wrapper('node', $project_node);
  $wrapper-&gt;field_freelancer-&gt;set($freelancer);
  // You missed
  $wrapper-&gt;save();
}