backdrop / backdrop-issues

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

Image dialog: upload breaks after switching to/from library select #5448

Open indigoxela opened 2 years ago

indigoxela commented 2 years ago

Description of the bug

The ajax image upload in the image dialog breaks after switching to library select and back to upload.

Steps To Reproduce

  1. Open a post node form and open the image dialog
  2. Switch to "Select from library" and back to "Upload an image"
  3. Try to upload an image

Actual behavior

No uploading spinner. Nothing happens, actually. And nothing in the browser console.

Closing and opening the image dialog again fixes it.

Note that when hitting the insert button, the file does get inserted, so it's probably only the spinner and upload display that's broken?

Expected behavior

The image gets uploaded

Additional information

indigoxela commented 2 years ago

Another odd thing: after an initial successful upload, if one removes that image and switches to library, the dialog resize behaves odd. It doesn't get centered horizontally in the viewport anymore.

Whoa... another bug: upload an image, do not remove, and switch to library. Back to upload, back to library... for every switch the uploaded image appears an additional time within the libary. And the files stay there. Switching to/from library actually adds the same file again and again (as temporary file). :disappointed: But that bug isn't always reproducible.

indigoxela commented 2 years ago

Aha! The file duplication bug is reproducible: choose a file of which the filename ends with a digit, like image_0.png.

Steps: