I can't figure out how to add image to a custom image field on a sepcific user.
$f = file_save_data($user['thumbnailphoto'][0], 'private://profile/'. $data['name'] .'.jpg', FILE_EXISTS_REPLACE);
$fid = $f->fid;
//Add to virtual map 'Profile images'
$file_entity = file_load($fid);
$file_entity->status = 1;
$file_entity->field_folder['und'][0]['tid'] = 180;
file_save($file_entity);
$user = user_load(334);
$details['field_profile_picture'] = array(
'und' => array(
0 => array(
'fid' => $fid,
)));
$u = user_save($user, $details);
But nothing get saved? Field_profile_picture is just an image field.
Thx!
LANGUAGE_UNDEFINED
or a$language
variable.dpm
after everyfile_save
,user_load
,user_save
call to be sure the actions are being performed?