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.

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


stBorchert’s picture

Status:Active» Needs review
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.

R.Hendel’s picture

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.

aaron’s picture

Dave Reid’s picture

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.


Status:Fixed» Closed (fixed)

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