338a339 > 341,344d341 < $file_fid = $file['fid']; < $file_filepath = $file['filepath']; < $file_filename = $file['filename']; < $file_description = $file['description']; 348,351d344 < $file_fid = $file->fid; < $file_filepath = $file->filepath; < $file_filename = $file->filename; < $file_description = $file->description; 358,359c351 < < if( !realpath($file_filepath) ) { --- > if( !realpath($file->filepath) ) { 363c355 < drupal_set_message("File is not where it should be: $file_filepath", 'warning'); --- > drupal_set_message("File is not where it should be: $file->filepath", 'warning'); 367c359 < $href = _private_upload_create_url($file_fid, $file_filepath, $file_filename); --- > $href = _private_upload_create_url($file); 369,370c361,366 < $form['attachments']['wrapper']['files'][$fid]['description']['#description'] = $description; < --- > $form['attachments']['wrapper']['files'][$fid]['description'] = array( > '#type' => 'textfield', > '#default_value' => (strlen($file->description)) ? $file->description : $file->filename, > '#maxlength' => 256, > '#description' => $description, > ); 730,732c726 < * @param file_id < * @param path to file < * @param name of file --- > * @param file object $file 735,736c729,730 < function _private_upload_create_url($file_fid, $file_filepath, $file_filename) { < if (_private_upload_is_file_private($file_filepath)) { --- > function _private_upload_create_url($file) { > if (_private_upload_is_file_private($file->filepath)) { 741,742c735,736 < $href = file_create_url((strpos($file_fid, 'upload') === FALSE ? $file_filepath : file_create_filename($file_filename, file_create_path()))); < if (_private_upload_is_file_private($file_filepath)) { --- > $href = file_create_url((strpos($file->fid, 'upload') === FALSE ? $file->filepath : file_create_filename($file->filename, file_create_path()))); > if (_private_upload_is_file_private($file->filepath)) {