Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Hi. We use a perl script to do mass filefield uploads (non-javascript, of course, it mimics the browser, opens /node/add/whatever, fills the form and clicks 'save' button). After upgrade, the script stopped working. Then I disabled js in Firefox and tried to upload a file - no luck, form just refreshes, and file isn`t attached. Previous filefield version did well.
Please, help, this functionality is critical for us.
Sorry for my English.
Comment | File | Size | Author |
---|---|---|---|
#3 | filefield_nojs_enctype.patch | 858 bytes | quicksketch |
#2 | filefield_nojs_enctype.patch | 860 bytes | quicksketch |
Comments
Comment #1
quicksketchThanks, looks like you're correct. I'll have a look at this at the first possibility.
Comment #2
quicksketchFound this problem rather quickly. The "enctype" property isn't set on the node form if JavaScript isn't used. This patch should fix the problem. You can also temporarily fix the problem simply by enabling upload.module and enabling it on that type (you don't have to actually use it at all), and that will set the enctype on the form to the right value.
Comment #3
quicksketchI've committed a slightly revised version that check #field['type'] == 'filefield' rather than #field['module']. Note that this change doesn't yet have any effect at all, since it's really left-over from D5 default images, see #338087: Default images on D6 imagefields?.
Comment #4
inductor CreditAttribution: inductor commentedThanks a lot, quicksketch! The patch fixed the problem.