[wp-trac] [WordPress Trac] #56922: Template / Template parts revision / autosave REST API are broken
WordPress Trac
noreply at wordpress.org
Tue Oct 10 22:32:49 UTC 2023
#56922: Template / Template parts revision / autosave REST API are broken
-------------------------------------------------+-------------------------
Reporter: spacedmonkey | Owner:
| spacedmonkey
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 6.4
Component: REST API | Version: 4.7
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests commit | Focuses: rest-api
needs-dev-note |
-------------------------------------------------+-------------------------
Comment (by ironprogrammer):
Replying to [comment:35 spacedmonkey]:
> > Any numeric ID added to the autosaves endpoint results in the same
response as without specifying an ID (e.g. /autosaves = /autosaves/1),
even if the post ID does not exist. Unsure if this is the expected
behavior.
>
> I was unable to replicate this error. Can provide more context.
>
> [[Image(https://core.trac.wordpress.org/raw-
attachment/ticket/56922/Screenshot%202023-10-10%20at%2008.56.12.png)]]
To replicate this, make sure there exists at least one autosave for the
template in question. E.g. in your example, modify the
`twentytwentyfour/home` template to create a revision, then in the DB
change the revision's `post_name` to replace "revision" with "autosave"
(like `1234-autosave-v1`). Then it shouldn't matter what numeric ID you
supply in the request, it will always return that autosave.
And thank you for reviewing the other noted items! It's good to know where
these refinements should be chased down.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56922#comment:43>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list