Gutenberg: Incorrect URL displayed when scheduling a post

Created on 27 Sep 2018  路  6Comments  路  Source: WordPress/gutenberg

Describe the bug
After scheduling a post, I receive a message in the side bar confirming that the post has been schedule and listing what the post address will be. However, the URL displayed for what the post address will be isn't what the actual URL of the post is set up as and instead displays the URL that appears when I am previewing the post in draft mode. Gutenberg version 3.9.0.

Expected behavior
I expected the URL displayed in the "The post address will be:" to be the final URL of the post.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: MacOS 10.13.6
  • Browser: Chrome
  • Version: 69.0.3497.100 (Official Build) (64-bit)
[Feature] Permalink [Feature] Saving [Type] Bug

All 6 comments

I can confirm this bug. I tested with Safari 12.0 on MacOS 10.13.6 with fresh WordPress install (runs in docker setup of Gutenberg) and pretty permalinks enabled. Actual post url is: http://localhost:8888/scheduled-post/, but Gutenberg shows url http://localhost:8888/?p=19

gutenberg-schedule-wrong-url

Confirmed. Pages actually show the future pretty permalink URL, but posts are showing the plain permalink, not the pretty version. So there is an inconsistency there. We should probably at least get that part addressed.

Screenshots from master:

image

image

Technically the URL it will be when actually published isn't in use yet, so it needs to be clear that that URL is the future URL.

So after digging a bit, this is because it uses the link field from the REST API response. That is generated using get_permalink() in core, which operates differently between pages, custom post types, and other _builtin post types (i.e. posts) for posts with a status of future.

See: https://core.trac.wordpress.org/changeset/31114

I think the solution here is to use getPermalink() instead of post.link.

I'm closing the issue as it seems now we don't have the UI that shows the future post address.

Thank you all for reporting and discussing this issue!

I'm closing the issue as it seems now we don't have the UI that shows the future post address.

Should we though? Should the post publish panel show the future address instead of the current one for scheduled posts?

The old editor showed the future post URL in the permalink space:
image

We're doing that now, but the post publish panel is a new concept. Should we customize it to display the future URL there instead of the current when it's a scheduled post?

Was this page helpful?
0 / 5 - 0 ratings