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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

Thanks, looks like you're correct. I'll have a look at this at the first possibility.

quicksketch’s picture

Status: Active » Needs review
FileSize
860 bytes

Found 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.

quicksketch’s picture

Status: Needs review » Fixed
FileSize
858 bytes

I'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?.

inductor’s picture

Thanks a lot, quicksketch! The patch fixed the problem.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.