After uploading a file and saving, file appears as it should in the correct location.

After going back and editing the node, "_0" is appended to the end of the filename on each save.

Initial upload: filename.pdf
Next save: filename_0.pdf
Next save: filename_0_0.pdf
Next save: filename_0_0_0.pdf

CommentFileSizeAuthor
#4 filefield_paths_0.patch737 bytesMilesDP5

Comments

harper1983’s picture

Title: "_0" appended to filename after each save » "_0" appended to filename after every other save save

Correction... Not sure what was going on before. However, now seeing _0 appended after every other save and removed on saves in between...

Initial upload: filename.pdf
Next save: filename_0.pdf
Next save: filename.pdf
Next save: filename_0.pdf
Next save: filename.pdf

egil’s picture

I can confirm this issue.

canzi’s picture

i can also confirm this issue

MilesDP5’s picture

StatusFileSize
new737 bytes

Bear with me as I'm new to Git. Here is a patch against 7.x-1.x.

The problem is that we are comparing the full file path (directory/filename.ext) against just the file name (filename.ext). Since these are always different the system tries to re-move the files into place which results in Drupals default behavior when two identical files exist, add '_0'. FileField Paths then removes the old files. So the user seen the file(s) name changing with '_0'.

aidanlis’s picture

Status: Active » Fixed

Committed to 7.x-1.x, let's hope you got lucky MilesDP5!

alexiosc’s picture

Version: 7.x-1.x-dev » 7.x-1.0-alpha1

I just manually patched 7.x-1.0-alpha1 and can verify it works, but I'll get back to you if I see any regressions.

Status: Fixed » Closed (fixed)

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

canzi’s picture

confirmed working - thank you