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.
I ran into a situation where I have a FileField in a Field Group midway through a multistep form and I wasn't able to upload a file. I would get this error:
An HTTP error 0 occurred.
/filefield/ahah/survey/field_my_survey_field/0
I have attached a patch that seems to fix the problem.
I am testing with FileField 6.x-3.5.
Comment | File | Size | Author |
---|---|---|---|
multistep-filefield.patch | 821 bytes | chey |
Comments
Comment #1
rogerpfaffWhich version of multistep do you have installed? In my 6.x-1.4 I can't apply the patch against multistep.module because your the lines you changed are not in the file.
EDIT: ok, I've found out that you patched against the dev version. will do the changes by hand in my 1.4 release.
Comment #2
chey CreditAttribution: chey commented@rogerpfaff Let us know how you make out.
Comment #3
rogerpfaffUnfortunately the change did not solve my problem. I tried it with and without fieldgroup and the error must be somewhere else. There are several issues with the http error 0 and I really hoped this one would be the solution but it's not.
Though it must be a problem with the multistep because when I use it the error appears if not it's working. Also when I set the filefield to 'All' in the multistep configuration the field disappears and is visible when I switch to the complete form.
Comment #4
chey CreditAttribution: chey commented@rogerpfaff Have you tried the dev code along with the patch?
Comment #5
rogerpfaffHi chey,
I've tested with the dev version and it works like a charm. :) thanks for the good work.
Comment #6
jhm CreditAttribution: jhm commentedIsn't this more an issue with filefield since it is not passing in the current step?
I added the following test to multistep.module:_multistep_get_current_step
Comment #7
chey CreditAttribution: chey commentedFileField has gone through a couple releases since I initially posted this. I went back and re-tested Multistep dev with the latest version of Filefield (6.x-3.7) and there appears to be no longer an issue. For me, it still did not work for Multistep 6.x-1.4 though.
Can anyone confirm this?
Comment #8
vkareh CreditAttribution: vkareh commentedCode in #6 is right. Actually, it's multistep's job to figure out which step does each field belong to. FileField is compliant with CCK's API, so Multistep should be aware of it. In any case, the 6.x-dev version of Multistep already verifies if it's an AHAH call and then asks CCK which step does it belong to.
FileField will not work on 6.x-1.4, since this change wasn't accounted at the time of release. Adding the code in #6 should fix it for most cases.
Comment #10
Sansui CreditAttribution: Sansui commented#6, thank you so much :) I wasn't using the latest dev version and couldn't figure out why filefields were breaking in my node form. What a relief!