I've created a content type with a link type field. When an user add this content type I want to prefill the link field with the user email. I've a create a new module named prefilllink with an alter hook :
function prefilllink_alter(&$form, &$form_state, $form_id) {
dsm($form);
switch($form_id) {
case "job_node_form":
$form["field_apply"]["und"][0]["value"]["#default_value"] = $user->mail;
break;
}
}
But it doesn't work... Any idea?