WordPress.org

Make WordPress Core

Opened 5 months ago

Closed 4 months ago

#53169 closed defect (bug) (fixed)

Media library upload freezes on multiple uploads from gallery

Reported by: glendaviesnz Owned by: antpb
Milestone: 5.8 Priority: normal
Severity: normal Version: 5.8
Component: Media Keywords: has-patch commit
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Related to https://github.com/WordPress/gutenberg/issues/11373, and possibly #50210

If adding a Gallery via Gutenberg, if a file is dropped onto the core media library the first upload succeeds as expected. If a second Gallery is added and another image dropped on the core media library this uploaded freezes and an uncaught exception Uncaught TypeError: Cannot read property 'text' of undefined in the `wp_includes/js/media-views.js file.

To replicate:

  1. Go to Posts > Add new.
  2. Add a title.
  3. Add a Gallery block.
  4. Click on Media Library inside the Gallery Block, add two photos.
  5. Enter the gallery on to the page. The photos appear. All is fine.
  6. Add another Gallery block.
  7. Click on Media Library in the Gallery Block again,
  8. Drag a photo onto the Media library to upload it.
  9. The upload bar shows 15%-ish done, but then just hangs. Nothing is shown on the far right side. If I click on the photo upload, I get the name of the image, so the Media library is only partially not working.
  10. Using the x on the upper right to close the Media library and opening it again, just brings up the same frozen upload.
  11. Drag another photo into the Media Library, upload also hangs.

Change History (10)

This ticket was mentioned in PR #1235 on WordPress/wordpress-develop by glendaviesnz.


5 months ago

  • Keywords has-patch added

Trac ticket: https://core.trac.wordpress.org/ticket/53169

Related to https://github.com/WordPress/gutenberg/issues/11373, and possibly https://core.trac.wordpress.org/ticket/50210
If adding a Gallery via Gutenberg, if a file is dropped onto the core media library the first upload succeeds as expected. If a second Gallery is added and another image dropped on the core media library this uploaded freezes and an uncaught exception Uncaught TypeError: Cannot read property 'text' of undefined in the `wp_includes/js/media-views.js file.
To replicate:

  1. Go to Posts > Add new.
  2. Add a title.
  3. Add a Gallery block.
  4. Click on Media Library inside the Gallery Block, add two photos.
  5. Enter the gallery on to the page. The photos appear. All is fine.
  6. Add another Gallery block.
  7. Click on Media Library in the Gallery Block again,
  8. Drag a photo onto the Media library to upload it.
  9. The upload bar shows 15%-ish done, but then just hangs. Nothing is shown on the far right side. If I click on the photo upload, I get the name of the image, so the Media library is only partially not working.
  10. Using the x on the upper right to close the Media library and opening it again, just brings up the same frozen upload.
  11. Drag another photo into the Media Library, upload also hangs.

#2 @prbot
5 months ago

glendaviesnz commented on PR #1235:

I don't know this part of the code well at all, and couldn't work out why theses values were undefined in some instances, so may be better to trace it further back and prevent this method being hit at all if these values are not defined.

#3 @SergeyBiryukov
5 months ago

  • Description modified (diff)
  • Milestone changed from Awaiting Review to 5.8

#4 @Mista-Flo
5 months ago

Hi there,

Thanks for the great explanation and the patch!

I can reproduce the bug.

After applying the patch, it fixes the issue, and I don't have the error on the console anymore. I can successfully publish a post and view it on the frontend (on trunk, last version of Gutenberg plugin enabled, twentytwenty theme enabled).

Good job 👏 👍

#5 @hellofromTonya
4 months ago

  • Keywords commit added

As @Mista-Flo tested it, marking for commit.

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


4 months ago

This ticket was mentioned in Slack in #core by antpb. View the logs.


4 months ago

#8 @antpb
4 months ago

  • Owner set to antpb
  • Status changed from new to assigned

This ticket was mentioned in Slack in #core by antpb. View the logs.


4 months ago

#10 @antpb
4 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In [51123]

Media: Allow multi-uploads in Galleries.
Previously, when more than one media item was uploaded using a gallery, failures occurred on the second upload.
Props glendaviesnz, Mista-Flo, hellofromTonya.
Fixes #53169.

Note: See TracTickets for help on using tickets.