Im using image fupload with a cck image field. I have the storage mode set to one image per node. Images upload preview and save perfectly. However when I click edit on any image node created using image fupload the edit page contains not only an option to edit or replace that image but also a number of "new upload" boxes. The number of these boxes is equivalent to the number I placed in the "number of values" box when configuring the image fupload widget. If I upload additional images using these boxes they appear as part of the original node ie I end up with several images inside one node. Im testing on firefox 3 and ie 6 and 7.
Comments
Comment #1
demm commentedWhat happens if you set "Number of values" of the imagefield to 1?
Isn't that your desired behavior?
Comment #2
grandcat commentedYou're right, demm. Single upload only tells fupload to upload one image per node. Nevertheless, filefield will create as many items as set in "Number of values".
I think, this should be clear.
Comment #3
Heather51 commentedThanks for the quick response. The editing Im referring to is not when the images are initially uploaded. That all works as you describe Im referring to clicking edit when viewing any image node uploaded using the fupload If I set the number of values to 10 I get 10 "new upload" boxes when editing the one image. I have my mode set to one image per node. Shouldnt this restrict the node edit for that image to only replace or remove that image. The way its working for me at the moment means users can add several images to one node - not what Im looking for. Im confused as to why Id set the number of values to one. My understanding of this module is that I can upload images en masse as separate nodes. Does that not mean that I should be able to edit them as separate nodes? Am I missing something fundamental about how the module works?
Comment #4
demm commentedOk, you're right.
I think this can be considered a bug.
Setting "Number of values" to 1 will prevent you from mass uploading.
Setting it to any higher number (or unlimited), will show additional upload boxes when editing a node, even though it should only have one image. Also, if you try to use one of those upload boxed, you'll get a nasty HTTP error and a screen with the plain AJAX response.
I think, while using the "One image per node" storage mode, the "Number of values" should be completely ignored and always be set to 1, but without restricting you to only upload 1 file at a time.
Comment #5
Heather51 commentedAgain thanks for the prompt response. This is a great module and one I'll be using on several sites so Id love to get it working as a user would expect.
Yes, this is the way I would expect the module to work. Am I correct in saying that currently the number of values in 'global settings' refers to the number of values if the storage mode is set to 'multiple images per node' and not the number of values allowed per session? Perhaps it would be better to move the "number of values" setting out of global settings if it only refers to 'multiple image' mode.
Comment #6
demm commentedIt is in the global settings, because it is derived from the original filefield/imagefield and is independent of which widget is used for the uploading.
I don't know what grandcat's plans are, but since filefield/imgefield got decoupled in the newest betas, which requires some rewrites in image_fupload, maybe it would be possible to move this setting to a more appropriate place.
Comment #7
grandcat commentedWell, I see it's a minor bug. I will fix it if I have the time, but before, more important issues have to be fixed.
Comment #8
grandcat commentedFixed in CVS Head.