Make WordPress Core

Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#46076 closed defect (bug) (reported-upstream)

Block editor preview not displaying unsaved changes to a post when meta boxes are active

Reported by: talldanwp's profile 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

  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

Attachments (1)

46076.diff (949 bytes) - added by pento 5 years ago.

Download all attachments as: .zip

Change History (9)

This ticket was mentioned in Slack in #core-editor by sheri. View the logs.


6 years ago

#2 @dlh
5 years ago

Related: #45768.

This ticket was mentioned in Slack in #core by benoitchantre. View the logs.


5 years ago

#4 @SergeyBiryukov
5 years ago

  • Component changed from General to Editor

#5 @noisysocks
5 years ago

  • Milestone changed from Awaiting Review to Future Release

@pento
5 years ago

#6 @pento
5 years ago

  • Milestone Future Release deleted
  • Resolution set to reported-upstream
  • Status changed from new to closed

Closing this, as it was ultimately fixed in GB11409.

The larger issue of supporting post meta revisions is tracked in #20564.

#7 @earnjam
5 years ago

I think you meant fixed in GB14877?

#8 @pento
5 years ago

Yep, thanks for noticing that, @earnjam!

Note: See TracTickets for help on using tickets.