[wp-trac] [WordPress Trac] #41445: post_parent can prevent media from embedding correctly
WordPress Trac
noreply at wordpress.org
Fri Feb 17 09:13:32 UTC 2023
#41445: post_parent can prevent media from embedding correctly
-------------------------------------------------+-------------------------
Reporter: loboyle | Owner:
| adamsilverstein
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 6.2
Component: Media | Version: 4.9.4
Severity: normal | Resolution: worksforme
Keywords: dev-feedback needs-unit-tests has- | Focuses: rest-api
testing-info needs-patch needs-testing |
-------------------------------------------------+-------------------------
Changes (by siddhantwadhwani):
* status: assigned => closed
* resolution: => worksforme
Comment:
**Testing from WordCamp Asia 2023 - Contributor Day from Thailand,
Bangkok. #WCAsia #Bluehost**
This report validates that the issue can be reproduced, and also applying
the latest patch seems to work straight-forward in the latest WordPress
nightly build.
**Applied and tested the patch:
[https://core.trac.wordpress.org/attachment/ticket/41445/41445.3.diff]**
Environment
OS: macOS Ventura 13.0.1
Web Server: Nginx
PHP: 7.4.33
WordPress: 6.2-beta2-55340-src
Browser: Chrome 109.0.5414.119
Theme: Twenty Twenty-Three (twentytwentythree)
Active Plugins:
SQL Buddy Version 1.0.0 by Delicious Brains
Actual Results
Error condition occurs (reproduced).
Patch-3 works successfully
**Additional Notes**
I tested the following scenarios:
**Scenario 1:** (Normal case)
1. Created a post & added a featured image. Published the post.
2. Created another post and added the same first (featured) image.
Published the post.
Performed a Rest API call for the second post through the browser and
Postman with media embedding enabled and was able to see appropriate data
appear under the wp:featuredmedia json body.
Reference: https://imgur.com/cC0emJN
**Scenario 2:** (Issue reproduced)
1. Created a post & added a featured image. Published the post.
2. Created another post and added the same first (featured) image.
Published the post.
3. Trashed the first post.
Noticed that on making the Rest API call for the second post, the
wp:featuredmedia data returned forbidden error with a 401 response status
code.
✅ Issue successfully reproduced.
Reference: https://imgur.com/Fxb89yi
**Scenario 3** (Applying Patch-3) @adamsilverstein
1. Ran the command npm run grunt patch:41445 and selected the 3rd patch to
apply (41445.3.diff)
2. Tested the end to end scenario again where I created the first and
second post afresh.
I noticed that despite both using the same featured image and trashing the
first one, the Rest api call for the second post wp:featuredmedia no
longer throws the forbidden error we were seeing earlier!
✅ Patch applied and worked successfully.
Reference:
Patch applied Rest API call response - https://imgur.com/RcU0s8H
**This concludes that this issue could still be reproduced and the latest
patch works fine for this scenario straight-forward in the latest
WordPress nightly build version**
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41445#comment:62>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list