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-> uid;
$project_node = node_load($node->field_projet['und'][0]['target_id']);
$wrapper = entity_metadate_wrapper('node', $project_node);
$wrapper->field_freelancer->value = $freelancer;
}