I just attempted an upgrade from filefield 5.x-2.2 to filefield 5.x-2.5 and noticed the following regression: the "Allowed extensions" description that used to appear under each field no longer does. I looked at the code, it's conditional on $field['widget']['allowed_extensions'] and this is apparently not set (even though the field definition does contain an extension string.

Here are a few minor other things that I'm too lazy to file separate bug reports for:
1. The "Maximum size" description suddenly appears (ok, not a regression, but different and it's apparently not configurable either, and not really needed in my app).
2. In case no files were uploaded, an empty and confusing filefield-filebrowser table header appears above the field. It used to be hidden and only appear if there is anything to be shown in the table (which made sense).
3. The "visible" column appears out-of-the-blue in the filefield-filebrowser table. I guess I now have to configure my fields to be always visible. It would have been nice to read about it in release notes (if admin action is indeed required). It would have been even to set the new option to the old default value during the upgrade, thus making an admin action optional rather than obligatory.

CommentFileSizeAuthor
#5 filefield_zero_fid.patch509 bytesjpl-2

Comments

quicksketch’s picture

Status: Active » Closed (won't fix)

Drupal 5 is no longer supported.

jpl-2’s picture

FYI, the disappearing "Allowed extensions" are because the database upgrade script has apparently stripped all file_extensions attributes from all file fields. Oh well, it's D5, so who cares about data loss.

jpl-2’s picture

And here is proof, the first two fields I fixed already, the last two fields are what filefield's database upgrade script has left behind:

mysql> select field_name,widget_settings from node_field_instance where widget_type='file';                                                           +---------------------------------+------------------------------------------------------------------+
| field_name                      | widget_settings                                                  |
+---------------------------------+------------------------------------------------------------------+
| field_anlage_1_f_plan_efre_erkl | a:2:{s:15:"file_extensions";s:3:"pdf";s:9:"file_path";s:0:"";}   | 
| field_anlage_2_f_plan_efre_deta | a:2:{s:15:"file_extensions";s:3:"xls";s:9:"file_path";s:0:"";}   | 
| field_anlage_3_f_plan_efre_pers | a:2:s:15:"file_extensions";s:3:"xls";s:9:"file_path";s:0:"";     | 
| field_anlage_4_f_plan_efre_gert | a:2:s:15:"file_extensions";s:3:"xls";s:9:"file_path";s:0:"";     | 
...

The above example also suggests the workaround. If you don't want to click yourself to death through the admin UI (and forget a few fields in the process), then fix the widget_settings syntax in node_field_instance yourself (and clear cache, otherwise the changes won't become effective).

jpl-2’s picture

But wait, there's more: the same clobbered syntax is also saved in node_field where type='file', which explains why the "list" column unexpectedly appears (which I misnamed "visible" in the original report).

jpl-2’s picture

StatusFileSize
new509 bytes

Finally, concerning the unnecessarily appearing filefield-filebrowser table, it pops up because the $items array occassionally contains a single item fid=0 rather than being empty (no idea why). For better or worse, it can be worked around in filefield with the attached patch.