Make WordPress Core

Opened 4 months ago

Closed 4 months ago

Last modified 4 months ago

#53421 closed defect (bug) (fixed)

Media: Empty library triggers loading spinner to spin constantly.

Reported by: peterwilsoncc Owned by: joedolson
Milestone: 5.8 Priority: normal
Severity: normal Version: 5.8
Component: Media Keywords: has-patch has-screenshots commit
Focuses: Cc:


Visiting the WP Admin > Media page will show as constantly loading in the UI (ie, the spinner never stops spinning) when the media library is empty.

Steps to recreate:

  1. Install from trunk/the latest beta (or delete all media items for an existing install).
  2. Visit WP Admin > Media
  3. Observe the loader spinner keep spinning

Introduced in [51145] for #50105. This restored the shape of the libraries AJAX response so it is possible something was missed while restoring.

Attachments (3)

Media Library ‹ test — WordPress 2021-06-16 14-57-23.jpg (133.5 KB) - added by adamsilverstein 4 months ago.
image-block.png (251.9 KB) - added by desrosj 4 months ago.
spinner.png (7.2 KB) - added by Presskopp 4 months ago.

Download all attachments as: .zip

Change History (14)

#1 @adamsilverstein
4 months ago

Hi @peterwilsoncc - thanks for catching and reporting this bug, and especially for identifying the offending commit!

I have a fix for a closely related ticket #53419 and in my testing the patch there resolves the spinner issue you were seeing. Can you please give this patch a test and verify it fixes the issue for you? https://core.trac.wordpress.org/attachment/ticket/53419/53419.diff

#2 @adamsilverstein
4 months ago

  • Keywords has-patch reporter-feedback added

#3 @desrosj
4 months ago

I'm also seeing this within the block editor when selecting Media Library in the image block.

4 months ago

#4 @desrosj
4 months ago

  • Keywords has-screenshots added

#5 @peterwilsoncc
4 months ago

  • Keywords commit added; reporter-feedback removed

Thanks @adamsilverstein,

Testing with 53419.2.diff:ticket:53419 (added shortly after your message above) appears to resolve the issue both on the Media page and in the editor's media library dialog.

Marking for commit in relation to this ticket pending Kelly's feedback on the related ticket.

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

4 months ago

This ticket was mentioned in Slack in #core-media by optimizewordpress. View the logs.

4 months ago

#8 @Presskopp
4 months ago

btw: when you click on "bulk select", the spinner is there again but also out of place

Last edited 4 months ago by Presskopp (previous) (diff)

4 months ago

#9 @joedolson
4 months ago

  • Owner set to joedolson
  • Status changed from new to accepted

#10 @joedolson
4 months ago

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

In 51187:

Media: Adapt response shape depending on type of query.

Restore inheriting the backbone fetch in the media library and adapt the AJAX response according to the action performed in the media query.

In [51145], the response shape was restored to the original shape, and a custom fetch was added to handle assigning the totalAttachments information in the collection. The custom fetch triggered a new set of bugs relating to zero-sized collections and loading individual images.

props adamsilverstein, ryelle, peterwilsoncc, Presskopp, desrosj.
Fixes #53421, #53419.

#11 @desrosj
4 months ago

In 51238:

Widgets: Avoid a TypeError when adding a widget in the Customizer.

This fixes a bug where action is set to null when adding a widget in the Customizer.

Fixes #53488. See #53421, #53419.

Note: See TracTickets for help on using tickets.