Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
The filefield_widget function sets the form encoding type incorrectly, erasing any other attributes that may exist on the form. It currently does $form['#attributes'] = array('enctype' => 'multipart/form-data');
. What it should do is $form['#attributes']['enctype'] = 'multipart/form-data';
, possibly checking first to make sure that the #attributes element exists and is an array.
In particular, the current mechanism will erase any custom classes that may have been added to the form previously.
Comment | File | Size | Author |
---|---|---|---|
#1 | filefield_enctype_set.patch | 809 bytes | quicksketch |
Comments
Comment #1
quicksketchOddly we were doing it correctly in 2 places but not in the third. This patch corrects the problem and has been applied to CVS. It will be in the 3.2 version.
Comment #2
quicksketch