I installed CCK and FileField on a fresh install of Drupal 6.3 to completely rule out any interference from other modules, and there are still two errors. One is FileField not uploading files when no extensions are defined (which is covered in other reports). The second bug, which this report is for, is that it will only allow files to be uploaded or removed (when editing content with a file field) if all the required fields are filled out. If all the required fields are filled out, it will upload (or remove) the file, but all the fields (including non-required ones) are wiped after the operation (i.e. they're blank when the creation form reloads to reflect the uploaded/removed file).
I hope this report is useful.
Comment | File | Size | Author |
---|---|---|---|
#17 | Clipboard01.jpg | 24.72 KB | korayal |
#15 | 286834.patch | 942 bytes | dopry |
#8 | filefield_286834.patch | 636 bytes | drewish |
#6 | filefield_286834.patch | 649 bytes | drewish |
#2 | filefield_286834.patch | 701 bytes | drewish |
Comments
Comment #1
eojthebraveThis patch sort of fixes the problem. It allows you to upload your files without filling out required fields. It still tries to validate all the form fields, and gives you errors for those that are not filled out, but still uploads the file.
[edit] For clarification: It looks like the problem is that the node object never gets rebuilt after submitting the form and uploading a file, so although the file does get uploaded it was not being displayed on the form because it hadn't been incorporated into the node object.
Comment #2
drewish CreditAttribution: drewish commentedtested and this works. looking around core it seems that all the node submit buttons are either using this as their #submit callback or their submit callbacks are calling it.
re-rolling to fix the indenting
Comment #3
dopry CreditAttribution: dopry commentedcommitted to HEAD.
Comment #4
Deciphered CreditAttribution: Deciphered commentedJust a heads up, removing a file still wipes all fields.
Comment #5
william_frane CreditAttribution: william_frane commentedAlso, a file can still only be removed if all the required fields are filled out.
Does this mean it's not possible to remove the "... field is required" messages when a file is uploaded? This didn't occur when uploading files with version 6.x-1.0-beta2.
I'm going to tentatively switch this back to "active" status; although the "... required" message isn't a technical problem (it doesn't affect functionality), the wiping of all fields when a file is removed is, at least from my point of view. A fix for this issue would be capital.
Comment #6
drewish CreditAttribution: drewish commentedthis fixes the problem with clearing the node after clicking remove but you still can't remove a file unless all validation passes.
Comment #7
william_frane CreditAttribution: william_frane commentedI just updated FileField today (July 31st, about 5 minutes ago), and it appears that most of the issues discussed in this thread are either still present or have returned since I last updated (on July 29th; if I recall correctly some of them were fixed in this update).
To be precise:
- All required fields must be filled out in order to upload or remove a file (it's back to the behaviour where a file doesn't show up/disappear after an upload/removal unless all the required fields were filled out)
- When a file is uploaded or removed, the title field is wiped (this is better than all the fields getting wiped, but still a problem)
Comment #8
drewish CreditAttribution: drewish commentedthe fix for #287946: Uploading Image wipes Multiselect field involved backing out these changes but dopry thought that this was still working.
update: re-rolled the patch to add the node_form_submit_build_node() call. i don't have any multiselects so it's not a problem for me but the validation problems are.
Comment #9
dopry CreditAttribution: dopry commentedthis is fixed in HEAD.. taxonomy still getting wiped out.. we need js handlers to fix that.. they're next.
Comment #10
drewish CreditAttribution: drewish commentedmarked #292398: Displays error if required fields aren't filled out, won't permit file removal as a duplicate
Comment #11
william_frane CreditAttribution: william_frane commentedFilefield (6.x-3.0-alpha1) still displays an error message if required fields aren't filled out when uploading a file, but will upload the file. Also, it won't remove an already uploaded file if the required fields aren't filled out.
Comment #12
Deciphered CreditAttribution: Deciphered commented@william_frane
It says fixed in HEAD, not fixed in 6.x-3.0-alpha1. It will never be fixed in 6.x-3.0-alpha1. If you don't want to download the dev build you'll have to wait for another official release.
Comment #13
Steve Dondley CreditAttribution: Steve Dondley commentedI just upgraded to head (cvs -b HEAD update) and I'm still seeing this issue.
Comment #14
Steve Dondley CreditAttribution: Steve Dondley commentedI should be more specific, here, because I posted here because of the last note at http://drupal.org/node/287946
The behavior I'm seeing is that my mult-select taxonomy control selects get wiped out after hitting "upload".
Comment #15
dopry CreditAttribution: dopry commentedthis issue will persist until I can get ajax uploads working. i've been having a really tough time with the ahah callbacks and I don't particularly feel like committing breakage to HEAD at this point... When I enable the ahah callbacks, I get the proper post when the ajax upload is initiated with no files to be uploaded. however if I try to upload a file i get not _POST in my ahah callback... It's really starting to drive me insane since my JS/jQuery debugging skills are passable, but still a little shy of expert. I don't really know what is happening with my posted data... attached is a patch for the current state of the AHAH callback.. I would really love to see post data in the request or at the server.
Comment #16
dopry CreditAttribution: dopry commentedfixed in HEAD.
Comment #17
korayal CreditAttribution: korayal commentedI'm getting this when I try to upload an image.
An HTTP error 0 occurred.
check the attachment.
(also http://drupal.org/node/286402#comment-958291 )
Comment #18
dopry CreditAttribution: dopry commentedif you've upgraded rebuild your menus. If you're using devel.module disable it.
Comment #19
dopry CreditAttribution: dopry commentedI've just committed an update that should block devel module interference.
Comment #20
korayal CreditAttribution: korayal commentedI've already disabled devel. by "rebuilding menus" do you mean clearing the menu cache?
Comment #21
alanburke CreditAttribution: alanburke commentedWell, you can now continue to use Devel module since the last commit by Dopry.
There is a link in the Devel module called 'Rebuild menus'.
That should do the trick.
Regards
Alan
Comment #22
korayal CreditAttribution: korayal commentedYep It worked now. Now my only problem is with imagefield :)
Comment #23
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.