Changes between Initial Version and Version 1 of Ticket #54708, comment 3
- Timestamp:
- 12/29/2021 06:27:46 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #54708, comment 3
initial v1 6 6 "if the post content is identical to the new content that is being auto-saved, the previous autosave revision is deleted to prevent having a redundant revision (i.e. if the update of the previous autosaved revision will make it identical to the current post, there is no need of it)." 7 7 8 This makes sense , except that because we return an error, a new autosave is never created. So the post now lacks and autosave, and this later causes `_set_preview` to [https://github.com/WordPress/wordpress-develop/blob/c5f9e9abeaf115d34834d94da3cf10f1fbd2077d/src/wp-includes/revision.php#L642 bail early], breaking preview functionality.8 This makes sense... except that since we return an error here, a new autosave is never created. So the post now lacks any autosave, and this later causes `_set_preview` to [https://github.com/WordPress/wordpress-develop/blob/c5f9e9abeaf115d34834d94da3cf10f1fbd2077d/src/wp-includes/revision.php#L642 bail early] - since it relies on the autosave, breaking preview functionality. 9 9 10 I would propose that since the autosave already exists with the correct data, we should leave it in place so previews continue working as expected. We can clean it up later, when the post is published for example.10 I would propose that since the autosave already exists with the correct data, we should leave it in place so previews continue working as expected. An alternate solution would be to update the login in `_set_preview` to work even without an autosave present.