Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview link broken until post is saved for the first time #2544

Closed
2 tasks
hartsook opened this issue Aug 27, 2017 · 10 comments
Closed
2 tasks

Preview link broken until post is saved for the first time #2544

hartsook opened this issue Aug 27, 2017 · 10 comments
Assignees
Labels
Core REST API Task Task for Core REST API efforts [Type] Bug An existing feature does not function as intended

Comments

@hartsook
Copy link

Issue Overview

Gutenberg 0.9
Preview link at top of page does not work unless I update the page first. I get a new browser tab -
about:blank. 

Steps to Reproduce (for bugs)

  1. Create Gutenberg post
  2. add content
  3. publish post
  4. edit post in Gutenberg
  5. make change in post
  6. click Preview link at top of page
  7. Chrome opens a new tab with about:blank URL
  8. This occurs in both author and admin roles
  9. If I Update the post first, then the Preview link works.

Expected Behavior

If I make changes in a post I should be able to preview the post before Updating, especially if this is a Published post and not a Draft post.

Preview link should work like it does currently.

Current Behavior

Preview link at top of page does not work unless I update the page first. I get a new browser tab about:blank. 

Possible Solution

Related Issues and/or PRs

Todos

  • Tests
  • Documentation
@youknowriad
Copy link
Contributor

Duplicate #1773 (comment) ?

@karmatosed
Copy link
Member

Despite #1773 being closed, I can still replicate this myself.

@karmatosed karmatosed added the [Type] Bug An existing feature does not function as intended label Sep 5, 2017
@karmatosed karmatosed added this to the Beta 1.2 milestone Sep 5, 2017
@aduth aduth added the Core REST API Task Task for Core REST API efforts label Sep 6, 2017
@mtias mtias modified the milestones: Needs API, Beta 1.2 Sep 6, 2017
@ptasker
Copy link
Contributor

ptasker commented Oct 10, 2017

Can also replicate this.

@hedgefield
Copy link

I can replicate this too by opening the demo post on my own site and hitting Preview right away. But that is likely related to the core issue I reported earlier, as I cannot (auto)save a post, so the REST API task label is 👌 .

@karmatosed karmatosed modified the milestones: Needs API, Merge Proposal Jan 25, 2018
@mtias mtias modified the milestones: Merge Proposal, Core API Mar 7, 2018
@aduth
Copy link
Member

aduth commented Mar 15, 2018

Current status: This was intentionally not implemented because it is not possible yet to support in the REST API.

Related:

@mtias mtias removed the [Type] Bug An existing feature does not function as intended label May 8, 2018
@danielbachhuber danielbachhuber added the [Type] Bug An existing feature does not function as intended label May 18, 2018
@danielbachhuber danielbachhuber changed the title Preview link opens blank tab not preview Preview link broken until post is saved for the first time May 18, 2018
@danielbachhuber
Copy link
Member

Looks like this is still an issue:

preview

Notably, it's a bug because the "Preview" button is broken until the first revision is saved. In my GIF, I write "Foo" in the title and then immediately hit the "Preview" button. The first preview UX is broken. However, by the time I navigate back, the first revision is saved and preview begins working correctly.

@danielbachhuber
Copy link
Member

Likely blocked by #6257

@danielbachhuber
Copy link
Member

@aduth Can you summarize the underlying issue here, and what needs to be done to address it?

@aduth
Copy link
Member

aduth commented Jun 6, 2018

@danielbachhuber See also #7179.

Basically, to be able to complete the redirect, we need a preview link. This is made available for a full save on the post endpoint's preview_link property. We don't have this yet for published posts autosave (#7179).

In parallel, the PostPreviewButton component should be refactored to rely less on the save process specifically, and merely the presence of this link. I'm working on this currently. Then, once the preview link is added for autosaves (returned by getEditedPostPreviewLink), it should "just work".

@aduth
Copy link
Member

aduth commented Jun 20, 2018

Closed by #7130.

@aduth aduth closed this as completed Jun 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core REST API Task Task for Core REST API efforts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

8 participants