If you upload a file within the media browser and moving the file to its final destination fails for whatever reason it is not possible to upload the same file again since the file uri (temporary://...) already exists in table file_managed.

Patch will follow.

Files: 
CommentFileSizeAuthor
#1 remove-temporary-file-2065871-1.patch978 bytesstBorchert
PASSED: [[SimpleTest]]: [MySQL] 62 pass(es).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new978 bytes
PASSED: [[SimpleTest]]: [MySQL] 62 pass(es).
[ View ]

Attached patch removes the file from temp directory and the database entry so the file can be uploaded again.

Status:Needs review» Reviewed & tested by the community

Thanks a lot, @stBorchert!
We've applied the patch on the production site which on which we've detected those errors and our customer confirmed us, that everything seems to work fine now. They can publish those galleries now which have been faulty before.

#1: remove-temporary-file-2065871-1.patch queued for re-testing.

Status:Reviewed & tested by the community» Fixed

I committed the patch without the watchdog() call because file_move() already does that for us if it fails.

http://drupalcode.org/project/media.git/commit/615829d

Status:Fixed» Closed (fixed)

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