gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Autosaved preview does not show featured images, categories, or tags

Open Emilybkk opened this issue 8 years ago • 6 comments

When create new post and assigned Featured image, Categories and tags, preview not show them until Save Draft first.

Emilybkk avatar Jul 07 '18 10:07 Emilybkk

Tested and confirmed using the following testing steps:

  1. Start a new post and give it a title and some content.
  2. Select a category, add a tag, and add a featured image.
  3. Click the "Preview" button.
  4. Note that the category, tag, and featured image are not shown in the preview.
  5. Close the preview.
  6. Click the "Save Draft" button.
  7. Click the "Preview" button.
  8. Note that you can now see the category, tag, and featured image in the preview.

Result: category, tag, and featured images are not shown for draft previews unless the "Save Draft" button is explicitly. (45s)

preview-before-save-draft Seen at http://alittletestblog.com/wp-admin/post.php?post=14016&action=edit running WordPress 4.9.7 and Gutenberg 3.2.0 using Firefox 61.0.1 on macOS 10.13.6.

What is the intended behavior? (@youknowriad may I ask you? 😊)

designsimply avatar Jul 18 '18 21:07 designsimply

Can I ask if it's a similar behavior in the classic editor?

IMO, this comes from the fact that the autosave endpoint only saves title, content and excerpt and when previewing posts, this endpoint is triggered which doesn't perform a full save (and also doesn't create revisions).

I think this is intended but better confirm with @aduth @adamsilverstein

youknowriad avatar Jul 19 '18 11:07 youknowriad

Can I ask if it's a similar behavior in the classic editor?

Currently in the classic editor previews do include all of the meta stored data, however a longstanding core bug means that any changed meta is actually saved to the live post when you perform the preview action (https://core.trac.wordpress.org/ticket/20299) although i think we fixed this for featured images recently.

adamsilverstein avatar Jul 19 '18 20:07 adamsilverstein

@youknowriad, fwiw, it makes sense to me that previewing featured images should always work because that potentially changes the view on the front end dramatically. I don't feel strongly about categories or tags but they sound like nice-to-haves. 😊

designsimply avatar Jul 19 '18 20:07 designsimply

So I think we should close this as invalid because the fact that classic editor saves those meta is considered a bug per @adamsilverstein's comment and not sure revisions/autosave allows saving more values than the content/title/excerpt.

Please correct me if I'm wrong.

youknowriad avatar Aug 15 '18 13:08 youknowriad

I'm closing as invalid, if it's not please reopen ;)

youknowriad avatar Aug 16 '18 13:08 youknowriad