silverstripe/silverstripe-framework — pull request #2922 by JayDevlin (2014-03-04 15:41:26+00:00)
Title: BUG Upload: loadIntoFile() duplicates files if replaceFile=true

UploadField->saveTemporaryFile() wants to use Upload->loadIntoFile() with an empty object.

If the object has no ID and replaceFile=true:
- Upload->load() doesn't try to find an existing File
- copy() will overwrite an existing file with the same filename
- a new file object is created
Result: Two file data records exists -- but only one file in the filesystem.

#2904