I have set the image field(file field) which has unlimited number of values, but on the node/add forum, there is no " add another item" button showing, the new image upload forum will only be showing after the first image has been uploaded.

I have chekced again and noticed there is no " add another item" button in "file field" as well. but it showing in the "text field" without problem

I need to have this " add another item" button showing otherwise no one knows he can upload another one. how can I solve this problem ?

D7 version

Thanks

Comments

john_b’s picture

The easy way to solve the problem would be some help text on the field, telling users that after they upload an image, they will have the option to upload more images.

If you do not like that solution, instead of ustomizing the default behaviour so as to force the 'Add another' button to show, you could look at this: https://www.drupal.org/project/multiupload_imagefield_widget

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

freelylw’s picture

thanks for reply, so for what you telling me is this default setting by drupal but not a bug from my site ? ?

freelylw’s picture

Is there any way I can force the " add another " button to show ?? Thanks

john_b’s picture

I spent quite long looking and I do not see a way to do it without custom coding. I cannot give you the code, you would have to look at the Drupal API for how the ajax add another button can be implemented.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

freelylw’s picture

I just don't understand the logic behind this . This button is showing on the text field with multi-value, but why doesn't show on the file/image field. totally don't understand.

john_b’s picture

There is probably no logic, just history, in the sense that general fields found their way into Drupal 7 core on the back a different contributed module than fields generally.

API for multiple-value forms: https://api.drupal.org/api/drupal/modules%21field%21field.form.inc/funct...

API for file fields: https://api.drupal.org/api/drupal/modules!file!file.field.inc/function/f...

This is a guess, and to get more reliable background on how Drupal got here, it may be worth trying to talk to some core developers on IRC.

It may also be worth researching this in more depth then raising an issue. However, with Drupal core developers working flat out on Drupal 8, the chances of anyone interested in fixing this kind of Drupal 7 problem (unless you feel willing and capable to working on it yourself) are probably not strong. It would be interesting to know whether this issue also affects Drupal 8 - I have not looked. If it does, the chances of getting people interested in fixing it may be a lot better, though it is still not going to be at the top of the list of urgent tasks.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

jkingsnorth’s picture

If this is still the behaviour in Drupal 8 then it might be worth raising a feature request, or submitted a patch, against it =]