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.
Upload module's form_alter currently resets form attributes wholesale:
$form['#attributes'] = array('enctype'] => 'multipart/form-data');
This breaks other modules as any attributes, e.g. a class they might have set are overwritten.
Instead in form_alter hooks we need to set just the key in question. In this case:
$form['#attributes']['enctype'] = 'multipart/form-data';
Comment | File | Size | Author |
---|---|---|---|
upload-form-alter-attributes.patch | 573 bytes | nedjo | |
Comments
Comment #1
Steven CreditAttribution: Steven commentedGood catch, thanks. Committed to HEAD.
Comment #2
(not verified) CreditAttribution: commented