backdrop / backdrop-issues

Issue tracker for Backdrop core.
144 stars 40 forks source link

File/image fields: Automatic file upload stops working if another multi-value field exists in the same form. #3396

Open klonos opened 5 years ago

klonos commented 5 years ago

Steps To Reproduce

To reproduce the behavior:

  1. On a vanilla Backdrop installation, edit the default Post content type.
  2. Add another file/image field to it (leave defaults as is)
  3. Start creating a node of type Post
  4. Add a title
  5. Click the "Choose file" button on the widget of the first file field.
  6. Try adding a file type that is not allowed to be uploaded on the field (for example, add a text or doc file if this is an image field) -> a validation error is thrown 👍🏼
  7. Click the "Choose file" button again, and this time add an image to the first file/image field -> the image is auto-uploaded 👍🏼 ...a thumbnail is created for it 👍🏼 ...and the "Remove" button is shown 👍🏼
  8. Click the "Choose file" button on the widget of the second file field.
  9. Add a file type that is not allowed to be uploaded on the field -> no validation error 👎🏼
  10. Add another file/image to the second field -> the file name is added to the field widget 👍🏼 ...but there is no preview (if the field you added is an image field) 👎🏼 ...the "Select existing file" button still remains present next to the field 👎🏼 ...the "Remove" button is not shown 👎🏼

Expected behavior

When multiple file/image fields are present on a form, auto-upload works for all of them, and works consistently:

Chas-Davis commented 5 years ago

Same issue here except I already had the image and file fields set to multiple before I started adding the content. Here's how things work for me:

Upload all files of the same field (eg. images). This works for the first field type.

Upload the second field type (eg. a PDF file). At this point, the auto-upload does NOT trigger. There is no progress bar or throbber.

If I save the content, the second field type (the PDF file) actually does get uploaded.

If I need to upload another of the second field, I have found a way to make it work. I can hit the preview button and then return to editing. The first PDF file is then shown and I'm back to where I can upload additional files. However, I can still only do multiple of a single field type.

Order of upload does not matter. The same behavior also occurs if I start with multiple uploads of the second field type and then try to do multiple of the first field.

jenlampton commented 5 years ago

no PR here, removing milestone. Adding the milestone-candidate tag so it can get into the next bug-fix release as soon as we have a PR.