WordPress.org

Make WordPress Core

Opened 2 months ago

Last modified 4 weeks ago

#53765 accepted defect (bug)

Media Library shows only the selected image

Reported by: benitolopez Owned by: joedolson
Milestone: 5.8.2 Priority: normal
Severity: normal Version: 5.8
Component: Media Keywords: needs-patch
Focuses: Cc:

Description

I don't know if this is a bug or if it is by design. But since WordPress 5.8, when you open the media libray that has a selection, only the selected image(s) is shown and other medias are not there. To show again the other images included in the library you need to filter the medias.

Seems that it happens only when using the classic editor. To reproduce the issue, you can set a featured image to a product of WooCommerce (for example). Or to any post type that is using the classic editor.

Previous versions of WordPress don't have this problem.

Attachments (2)

53765-reproduced-issue.gif (4.1 MB) - added by hellofromTonya 2 months ago.
Testing: reproduced when upgrading from 5.7.2 to 5.8.0
53765-reproduced-issue2.gif (6.8 MB) - added by hellofromTonya 2 months ago.
Testing: additional reproduced testing

Change History (15)

@hellofromTonya
2 months ago

Testing: reproduced when upgrading from 5.7.2 to 5.8.0

#1 @hellofromTonya
2 months ago

Testing Report

Testing Environment:

  • OS: macOS Big Sur 11.4
  • Localhost: Local
  • WordPress: 5.7.2 and the 5.8.0
  • Activated plugins: Classic Editor plugin
  • Theme: Twenty Twenty-One
  • Browser: Chrome Version 91.0.4472.114, Firefox 89.0.2 (64-bit), Safari 14.1.1

Testing steps to reproduce:

  • Install and active the Classic Editor plugin
  • Switch to 5.7.2 (Local testing: use the Core Rollback plugin.)
  • Add multiple images to the Media Library (at least 2)
  • Create a new post
  • Set the Featured Image
  • Save the post
  • Click on the image in the Featured image field to reopen the modal -> notice all of the items in the media library including the selected one are displayed
  • Upgrade to 5.8.0
  • Go back to that post
  • Click on the featured image again to reopen the modal -> notice only the selected image is displayed

Results:

  • Reproduced issue when using the Classic Editor as shown in 53765-reproduced-issue.gif in each browser ❌
  • No errors in browser console ✅
  • error.log is empty ✅
  • Confirmed the issue does not happen with block editor, when Classic Editor plugin is not activated ✅
Last edited 2 months ago by hellofromTonya (previous) (diff)

#2 @hellofromTonya
2 months ago

  • Milestone changed from Awaiting Review to 5.8.1

Hello @benitolopez,

Welcome to WordPress Core Trac! Thank you for reporting this.

I was able to reproduce the issue. It does look like a regression. Moving it into 5.8.1 for further investigation.

@hellofromTonya
2 months ago

Testing: additional reproduced testing

#3 @hellofromTonya
2 months ago

  • Keywords needs-patch added

I was curious what happens when deselecting or removing the featured image. Are users able to get access to the rest of the media library? 53765-reproduced-issue2.gif shows the results of the testing.

Yes, users can regain access but only when following these steps:

  • Remove the featured image
  • Save or update
  • Select to add a feature image to reopen the media library modal

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


2 months ago

#5 @joedolson
2 months ago

Testing report:

Testing Environment:

OS: Windows 10
Localhost: no
WordPress: 5.7.2 and then 5.8.0 nightly 7/27/2021
Activated plugins: Core Rollback, WordPress Reset, Beta Tester
Theme: Twenty Twenty-One
Browser: Chrome 92.0.4515.107 (Official Build), Firefox 90.0.2

Could not reproduce issue in either of these environments.

Note: not a valid test, as it was performed using the block editor.

Last edited 2 months ago by joedolson (previous) (diff)

#6 @benitolopez
2 months ago

I just tried it with Windows to make sure it wasn't related to a different OS. I'm still having the issue: Windows 10, WordPress 5.8 and Chrome (92.0.4515.107).

Same with Big Sur 11.5.1, WordPress 5.8 and Chrome (92.0.4515.107).

Again, this happens only when using the classic editor. If the post type uses the Block Editor, the featured image works correctly.

#7 follow-up: @joedolson
2 months ago

Ah; I followed the testing instructions, but didn't notice that the original ticket specified classic editor.

@hellofromTonya Can you edit the testing instructions to specify that the Classic Editor needs to be activated?

#8 in reply to: ↑ 7 @hellofromTonya
2 months ago

Replying to joedolson:

Ah; I followed the testing instructions, but didn't notice that the original ticket specified classic editor.

@hellofromTonya Can you edit the testing instructions to specify that the Classic Editor needs to be activated?

Thanks for the ping @joedolson! Testing report and steps are updated. Sorry for missing the information in the report 🤦‍♀️.

Retested with and without the Classic Editor plugin activated. Confirmed it only happens in the classic mode and not with the block editor. Testing report updated.

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


7 weeks ago

#10 @joedolson
7 weeks ago

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

#11 @peterwilsoncc
5 weeks ago

I did a bisect today, it appears to have been introduced in [50829].

While testing today, it happens in:

  • classic editor featured image (per image above)
  • classic editor inline image (click edit then replace buttons)
  • block editor classic block inline image (click edit then replace buttons)

With infinite scrolling enabled via add_filter( 'media_library_infinite_scrolling', '__return_true' ); the issue doesn't happen so I suspect the get-attachment action is confusing the logic and the load more button isn't displaying as it doesn't have the data.totalAttachments property.

I think when replacing an image there ought to be two initial ajax requests, one to get the selected attachment and one to get the first page of attachments via the query-attachments action.

#12 @circlecube
4 weeks ago

To be considered for the next release (5.8.1) this will need a patch and testing before RC1 which is scheduled for Wednesday, Sept 1.

#13 @desrosj
4 weeks ago

  • Milestone changed from 5.8.1 to 5.8.2

With 5.8.1 RC due out in less than 24 hours, I'm going to punt this one to 5.8.2.

Note: See TracTickets for help on using tickets.