Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Right now we have:
[ ] Disable the "Remove" button in file listings
It's already confusing that the button in question is a negative, but to have an inverted checkbox makes it worse, especially between checkboxes for "Enable Description field" and "Display a "Show/Hide Hidden Files" toggle in file listings".
Let's invert this to a checkbox that defaults to true, called "Display the "Remove" button when editing files" (more or less).
Comments
Comment #1
jthorson CreditAttribution: jthorson commentedSmall caveat for consideration ... if the module is enabled after content has been created on the site, then existing file field widgets won't have the setting in question until the field settings are updated. Thus, if we reverse this, simple changing !empty() to empty() when checking the setting will not suffice ... for a default 'checked' state, it will need to also accommodate the !exists() scenario in the logic.
Comment #2
dwwAhh, and since we're not defining a separate widget anymore, we can't have the widget's default values handle it for us, either. Good point.
Still think this is relatively easy and worth doing, but obviously not a blocker...
Comment #3
jthorson CreditAttribution: jthorson commentedComment #4
dwwSee also #1965082: Give spam-fighters a way to remove other people's files
Comment #5
dwwSince this was sort of in the way of some other stuff, and it was trivial, I just pushed this to 7.x-1.x:
http://drupalcode.org/project/extended_file_field.git/commit/31d648a
Comment #6
dwwWhoops, I missed a case:
http://drupalcode.org/project/extended_file_field.git/commit/9fa89a4
See also #1964100-9: Refactor extended_file_field_field_formatter_view() structure