Hi,
currently a token replacement like [ffp-name-only-original].[ffp-extension-original] does not cover the case
of filenames ending with a dot but with no extension (e.g. file.).
In these cases the replacement ends up adding an extra dot at the end of the destination name giving file.. as result.
This is because the token regexes for the file names assume that there are always characters after the last dot when extracting the extension to subtract from the file name, I think this assumption can be relaxed.
I am going to send a patch which also covers some extra degenerate cases.
I tested the new regexes with these cases:
- file
- file.
- file.ext
- .ext
JFTR, I experienced the problem with files coming from a D6 site I am migrating to D8, in D6 uploading files with any extension was allowed.
Ciao,
Antonio
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | Improve-token-replacement-for-files-without-extension-2926312-3.patch | 2.31 KB | ao2 |
| #3 | interdiff-2-3.diff | 534 bytes | ao2 |
Issue fork filefield_paths-2926312
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
ao2 commentedHere is a tentative patch.
Comment #3
ao2 commentedSending an updated patch as the previous one contained a typo which caused this warning:
Comment #4
volegerNeeds MR
Comment #7
chandansha commentedPlease Review the code and let me know if i missed anything.
Thanks!!
Comment #8
volegerWe need to improve the token integration test with cases of uploaded files without extension.