Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#53421 closed defect (bug) (fixed)

Media: Empty library triggers loading spinner to spin constantly.

Reported by: peterwilsoncc's profile peterwilsoncc Owned by: joedolson's profile 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 3 years ago.
image-block.png (251.9 KB) - added by desrosj 3 years ago.
spinner.png (7.2 KB) - added by Presskopp 3 years ago.

Download all attachments as: .zip

Change History (14)

#1 @adamsilverstein
3 years 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?

#2 @adamsilverstein
3 years ago

  • Keywords has-patch reporter-feedback added

#3 @desrosj
3 years ago

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

3 years ago

#4 @desrosj
3 years ago

  • Keywords has-screenshots added

#5 @peterwilsoncc
3 years 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.

3 years ago

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

3 years ago

#8 @Presskopp
3 years ago

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

Last edited 3 years ago by Presskopp (previous) (diff)

3 years ago

#9 @joedolson
3 years ago

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

#10 @joedolson
3 years 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
3 years 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.