Index: modules/file/file.field.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/file/file.field.inc,v retrieving revision 1.10 diff -u -p -r1.10 file.field.inc --- modules/file/file.field.inc 11 Nov 2009 08:32:35 -0000 1.10 +++ modules/file/file.field.inc 29 Nov 2009 19:06:05 -0000 @@ -256,7 +256,21 @@ function file_field_update($obj_type, $o // Check for files that have been removed from the object. // On new revisions, old files are always maintained in the previous revision. - if ($object->is_new || (isset($object->revision) && $object->revision)) { + if (isset($object->revision) && $object->revision) { + return; + } + + // Make sure to set the status of the file to permanent so it is not garbage + // collected as a temporary file. + foreach ($items as $delta => $item) { + $file = file_load($item['fid']); + $file->status = $item['status'] = 1; + file_save($file); + } + + // If the object is new, we're done, we don't need to clean up any + // existing file fields. + if ($object->is_new) { return; }