[wp-trac] [WordPress Trac] #46076: Block editor preview not displaying unsaved changes to a post when meta boxes are active

WordPress Trac noreply at wordpress.org
Wed Jan 23 07:40:16 UTC 2019


#46076: Block editor preview not displaying unsaved changes to a post when meta
boxes are active
--------------------------+-----------------------------
 Reporter:  talldanwp     |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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

 > 1. A published post is previewed, generating an autosave.
 > 2. 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.
 > 3. 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
 > 4. The modified date of the post is now more recent than the autosave,
 so the autosave is deleted.
 > 5. The preview loads, but there's no more autosave to preview.

 **To test:**
 1. Create a new post using the block editor
 2. Open the options dialog and enable 'Custom Fields'
 3. Add a title, content and a custom field to the post and save it
 4. 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

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46076>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list