Download & Extend

List of current extensions gets extra commas when validation fails

Project:FileField
Version:6.x-3.7
Component:Code
Category:bug report
Priority:minor
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

When the list of Permitted upload file extensions: is changed to allow bmp, or tiff, the module throws an error, and oddly adds additional commas between all of the existing file extensions.

To reproduce:
1) configure an image field
2) attempt to add tiff to the list
3) note error, then note list (now says png,, gif,, jpg,, jpeg,, tiff)
4) delete tiff, replace with bmp, try to save again
5) note error, the note list (now says png,,, gif,,, jpg,,, jpeg,,, bmp)

Comments

#1

Project:ImageField» FileField
Version:6.x-3.7» 6.x-3.7

Thanks, moving this over to FileField, since it's responsible for the extension list field.

#2

Status:active» fixed

I've committed this fix which prevents the extra commas from showing up. It also allows preceding dots before file extensions but automatically strips those out upon saving. This should help a lot and follow the practice of "accept values loosely, store them consistently".

AttachmentSize
filefield_extension_check_fix.patch 1.22 KB

#3

Status:fixed» closed (fixed)

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