Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#48314 closed defect (bug) (duplicate)

REST endpoint for getting media will return 401 if first post to use it as featured image is in the trash

Reported by: andregumieri's profile andregumieri Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.3
Component: REST API Keywords:
Focuses: rest-api Cc:

Description

Version:
5.2.4

Steps to reproduce:

  • Create a post
  • Upload a featured image to it
  • Save the post and then send it to trash
  • Create a second post
  • Use the same featured image as the trashed post
  • Save the post
  • Try to access the media through /wp-json/wp/v2/media/<id>

The result will be
{"code":"rest_forbidden","message":"Sorry, you are not allowed to do that.","data":{"status":401}}

Expectation would be to have the featured image data

Change History (3)

#1 @kadamwhite
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Thank you for your error report, @andregumieri ! This ticket is a known issue, previously tracked in #41445 — because of that, I am going to close this as a duplicate. We do appreciate your calling this bug out, and we are discussing potentially making this one of our priorities for 5.4.

If you have any interest in collaborating on a solution, I'd welcome your participation on the thread in the other ticket!

#2 @andregumieri
5 years ago

Thank you @kadamwhite :) I searched in every way I could imagine and didn't find this ticket. :p

#3 @kadamwhite
5 years ago

@andregumieri No worries, that sounds like most of my interactions with Trac! 😁

Note: See TracTickets for help on using tickets.