WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 21 months ago

#23409 closed defect (bug) (duplicate)

Featured Images Not Working when From Media Library

Reported by: saracup Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.5.1
Component: Media Keywords:
Focuses: Cc:

Description

I am in 3.5.1, Multisite, all plugins disabled, using Twenty-Twelve theme. While editing a post, when clicking on "Set Featured Image" in the meta box, I get the popup and select the image. I then click "Save Featured Image." The box closes. The meta box displays nothing -- just the original "Set Featured Image" link. So, I Update the post. Still, no featured image.

Going through the above steps, I decide instead to upload an image from my computer. When I do, and select it as my featured image, it works.

It seems to choke only on files that are already in the media library.

Change History (5)

comment:1 follow-up: @saracup2 years ago

Using the backtrace-error.php file, I go to the media library. My thumbnails are blank, and there is an error on every image. The error refers to "wp-includes/capabilities.php." and is worded, for each image, as follows:
Backtrace from warning 'Trying to get property of non-object' at /[my server filepath]/wp-includes/capabilities.php 1075:

  1. calling map_meta_cap()
  2. /[my server filepath]/wp-includes/capabilities.php 926 calling call_user_func_array()
  3. calling has_cap()
  4. /[my server filepath]/wp-includes/capabilities.php 1289 calling call_user_func_array()
  5. /[my server filepath]/wp-admin/includes/class-wp-media-list-table.php 306 calling current_user_can()
  6. /[my server filepath]/wp-admin/includes/class-wp-list-table.php 796 calling display_rows()
  7. /[my server filepath]/wp-admin/includes/class-wp-list-table.php 736 calling display_rows_or_placeholder()
  8. /[my server filepath]/wp-admin/upload.php 240 calling display()
Last edited 2 years ago by scribu (previous) (diff)

comment:2 follow-ups: @Eric J T2 years ago

I get the same issue as saracup, except I find that if I select an image from the media library that is not in the post already it will set it as the featured image. This never happened before updating to 3.5.1. If this is by design it is rather inconvenient as I would have to upload a second copy of the image I want but with a different file name.

BUT ALSO My experience with this has been that when imagename2011.jpg is in the saved post, and I just happened to have a second copy of it named imagename20111.jpg wp would NOT let me set it as featured image. I had to upload a new copy of the one I wanted used but named it image_name_2011.jpg and I was able to set it as featured image.

Also, in previous versions of WP I was able to set the featured image at the same time i was selecting an image to insert, using a link at the bottom of the dialog. This was very convenient and I would love to have that functionality restored to WP. A great time saver. Please?

comment:3 in reply to: ↑ 1 @SergeyBiryukov2 years ago

Replying to saracup:

Backtrace from warning 'Trying to get property of non-object' at /[my server filepath]/wp-includes/capabilities.php 1075

Sounds like a duplicate of #22312 and #23154.

comment:4 in reply to: ↑ 2 @SergeyBiryukov21 months ago

Replying to Eric J T:

Also, in previous versions of WP I was able to set the featured image at the same time i was selecting an image to insert, using a link at the bottom of the dialog. This was very convenient and I would love to have that functionality restored to WP. A great time saver. Please?

Related: #22970, #22963.

comment:5 in reply to: ↑ 2 @SergeyBiryukov21 months ago

  • Keywords needs-testing needs-patch removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Replying to Eric J T:

I get the same issue as saracup, except I find that if I select an image from the media library that is not in the post already it will set it as the featured image. This never happened before updating to 3.5.1. If this is by design it is rather inconvenient as I would have to upload a second copy of the image I want but with a different file name.

No, this is not by design. However your issue appears to be different from what is described in comment:1.

Feel free to create a new ticket with the steps to reproduce on a clean install if there's still a problem. Going to close this one as a duplicate of #22312 and #23154.

Note: See TracTickets for help on using tickets.