#58739 closed defect (bug) (fixed)
Return original autosave after saving with unchanged data
Reported by: | adamsilverstein | Owned by: | adamsilverstein |
---|---|---|---|
Milestone: | 6.3 | Priority: | normal |
Severity: | normal | Version: | 6.2 |
Component: | Revisions | Keywords: | has-patch has-unit-tests commit add-to-field-guide |
Focuses: | Cc: |
Description
This is a follow up to https://core.trac.wordpress.org/ticket/49532. In https://core.trac.wordpress.org/changeset/55154 the autosave endpoint was adjusted so that if the autosave was a duplicate (no data had changed) an error was returned. This fixed an issue where the autosave would be deleted and recreated each time the (unchanged) data was saved.
Unfortunately, this caused at least two regressions as noted in https://core.trac.wordpress.org/ticket/49532#comment:33 and https://github.com/WordPress/gutenberg/issues/51088.
After reviewing this more carefully, a better approach would be to return the original autosave instead of an error - that way, endpoint consumers will get the data back in the shape the expect and the autosave will work as expected.
Patch incoming
Attachments (1)
Change History (10)
This ticket was mentioned in PR #4807 on WordPress/wordpress-develop by @adamsilverstein.
15 months ago
#2
- Keywords has-patch has-unit-tests added; needs-patch removed
#3
@
15 months ago
Thank you, Adam!
I re-tested the patch, and it works as expected.
There's no longer a 400 error when previewing an already published post, and thumbnail changes are reflected in the previews.
#6
@
15 months ago
@adamsilverstein This is a change in behaviour for the REST API. As this is a change, it needs to be either called out in the field guide or have a dev note.
#9
@
15 months ago
Thinking more appropriate for field guide since it is a relatively small change/note and more than likely fixes a bug for developers rather than needing them to make some change in their code. Before 6.2 the endpoint always returned an autosave and this restores that behavior, so probably what developers already expect from the endpoint.
Trac ticket: https://core.trac.wordpress.org/ticket/58739