Undefined variable: source in field_file_save_file() (field_file.inc)

  if (!file_copy($file, $file->destination, FILE_EXISTS_RENAME)) {
    form_set_error($source, t('File upload error. Could not move uploaded file.'));
    watchdog('file', 'Upload error. Could not move file %file to destination %destination.', array('%file' => $file->filename, '%destination' => $file->filepath));
    return 0;
  }

$source should be changed to $file->source
and $file->filepath should be changed to $file->destination

Comments

dopry’s picture

Can you please roll a patch? see: http://www.drupal.org/diffandpatch

Pasqualle’s picture

I do not use this module, I just tested that function. I do not have the time now to work on something I do not use, sorry..

dopry’s picture

Status: Needs review » Fixed

fixed in HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.