-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
Description
When editing for the 1st time a template or template part and saving, the result of the edit is saved in the database. That becomes the 1st version of the post saved. This is erroneous because compared to the original version saved on disk, the 1st version saved in the database contains edits. This leads to a poor UX like the one described in #48610 where users think their edits have not been saved as a revision.
The templates and template parts are not in the database and the 1st time they're edited they're basically added to the database, along with their edit. This shows up as two revisions, one with an empty post and one with the post having all the content (including the 1st edit).
Starting only with the 2nd edit, which will result in 3 available revisions, will we see actual diffs.
Step-by-step reproduction instructions
- Start a fresh WordPress install with Gutenberg 15.2 installed and
- Open the Site Editor and open a template or template part to
- Add a paragraph with text to the template and save the changes.
You can check for template revisions immediately, or after closing and re-opening the Site Editor. But none will.
- Edit the template again and make a different change, like adding an image, and saving the changes.
After this edit - revisions will start showing.
props @jordesign
Screenshots, screen recording, code snippet
revisions-after-one-edit.mp4
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes