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.
#attribute is listed as one of the attributes a file element can have. It is listed in the Form API Reference
http://drupaldocs.org/api/head/file/contributions/docs/developer/topics/forms_api_reference.html#file
so we should have it implemented. Here is a patch that does just that.
Comment | File | Size | Author |
---|---|---|---|
attributes_for_file.patch | 1.12 KB | vhmauery | |
Comments
Comment #1
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedWhat do you need this for?
Comment #2
vhmauery CreditAttribution: vhmauery commentedAcidfree uses a nice little piece of javascript that sets the title field of the node (if it is empty) when the filename changes.
That and ALL the items should have #attributes per the documentation. The real question is why not. Leaving it out really limits the possibilities of file fields.
Comment #3
Dries CreditAttribution: Dries commentedCommitted to HEAD.
Comment #4
Dries CreditAttribution: Dries commented