WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 7 weeks ago

#39824 assigned defect (bug)

Gallery doesn't show images being uploaded

Reported by: gonom9 Owned by: adamsilverstein
Milestone: 5.4 Priority: normal
Severity: normal Version: 4.0
Component: Gallery Keywords: has-patch reporter-feedback 2nd-opinion
Focuses: javascript Cc:
PR Number:

Description

When you insert a gallery with images being uploaded in Edit Post page, the gallery doesn't show the images.

How to Reproduce

  1. Open Edit Post page.
  2. Insert a gallery with one uploaded image.
  3. Select the gallery in tinyMCE then click on Edit.
  4. Upload a big image file and/or slow down the internet to buy time for the following actions.
  5. Choose Edit Gallery tab then click on Update Gallery button while the big image is uploading.
  6. The gallery shows an empty element instead of the image.
  7. If you edit the gallery and open Edit Gallery tab after the image uploaded, you'll see it has gone.

Attachments (2)

39824.diff (3.0 KB) - added by adamsilverstein 3 years ago.
39824.2.diff (2.8 KB) - added by adamsilverstein 2 years ago.

Download all attachments as: .zip

Change History (8)

#1 @adamsilverstein
3 years ago

@gonom9 thanks for the bug report.

I verified this issue and captured a screencast to demonstrate the issue: https://cl.ly/3F0s1y0j021h

I have a potential solution I will upload shortly that disables the insert gallery button when you are in the process of uploading videos. I'm not certain this is the best approach, but it does prevent you from creating the broken condition you noted.

#2 @adamsilverstein
3 years ago

  • Focuses javascript added
  • Keywords has-patch reporter-feedback 2nd-opinion added
  • Version changed from 4.7.2 to 4.0

In 39824.diff:

Media: Disable the Insert/Update Gallery button while uploads are in progress.

Is there a better approach to resolving this issue?

@gonom9 can you give this a test and see if it resolves the issue for you?

#3 @adamsilverstein
3 years ago

  • Milestone changed from Awaiting Review to Future Release
  • Owner set to adamsilverstein
  • Status changed from new to assigned

#4 @adamsilverstein
2 years ago

39824.2.diff: refresh patch against trunk.

Last edited 2 years ago by adamsilverstein (previous) (diff)

#5 @adamsilverstein
2 years ago

Testing the patch, it is not working as expected. during the upload process models are note getting the 'uploading' attribute set to true (instead it is undefined, while for uploaded posts it is false). This seems like a regression and will take some more digging to see why this is happening.

#6 @adamsilverstein
7 weeks ago

  • Milestone changed from Future Release to 5.4

I still see a similar issue in WP 5.3 with the block editor: if you create a gallery, you can drop images onto the modal and then close it before uploads complete. Reopening media and editing the Gallery will show the upload progress, and update the gallery with completed items. Screencast reproducing issue in 5.3: https://share.getcloudapp.com/2NurEe2L

The original solution of disabling the "Insert/Update Gallery" button while uploads are in progress still feels right and would be a nice improvement. I'm going to revisit this for 5.4.

Note: See TracTickets for help on using tickets.