#46076 closed defect (bug) (reported-upstream)
Block editor preview not displaying unsaved changes to a post when meta boxes are active
Reported by: | talldanwp | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Editor | Keywords: | |
Focuses: | Cc: |
Description
Originally created as a github issue, for background see here:
https://github.com/WordPress/gutenberg/issues/12617
The cause of this is explained in this comment:
https://github.com/WordPress/gutenberg/issues/12617#issuecomment-452604656
- A published post is previewed, generating an autosave.
- The POST request to save PHP meta boxes is sent to post.php. The published post is updated and its last-modified time is bumped.
- The POST request is redirected as a GET request to post.php again. This logic runs, which compares the modified dates of the autosave and the post: https://github.com/WordPress/wordpress-develop/blob/e5b5db9e2349dfe8a43ac42bea5738146f53994d/src/wp-admin/edit-form-blocks.php#L294-L303
- The modified date of the post is now more recent than the autosave, so the autosave is deleted.
- The preview loads, but there's no more autosave to preview.
To test:
- Create a new post using the block editor
- Open the options dialog and enable 'Custom Fields'
- Add a title, content and a custom field to the post and save it
- Add some further changes to the post content and click the preview button
Expected behaviour
Changes added in step 4 are displayed in the preview
Actual behaviour
None of the changes are visible in the preview
Attachments (1)
Change History (9)
This ticket was mentioned in Slack in #core-editor by sheri. View the logs.
6 years ago
This ticket was mentioned in Slack in #core by benoitchantre. View the logs.
6 years ago
Note: See
TracTickets for help on using
tickets.
Related: #45768.