WordPress.org

Make WordPress Core

Opened 7 years ago

Last modified 5 months ago

#23781 new defect (bug)

New Post Publishes to Wrong URL

Reported by: miqrogroove Owned by:
Milestone: Priority: normal
Severity: critical Version: 3.4.2
Component: Permalinks Keywords:
Focuses: Cc:
PR Number:

Description

The "Permalink" displayed in the editor for new posts may be wrong, and changes (surprise!) when the Publish button is clicked.

Steps to reproduce this:

  1. Start typing a title in a new post.
  2. Wait for an auto-save and Permalink to appear.
  3. Make the title longer.
  4. Type a post body.
  5. Click Publish.

Expected result:

The new post should be published at the Permalink being displayed on the post editor.

Actual result:

A completely different permalink is generated based on the current title. The new page gets cached at the "wrong" URL before any changes can be made. General pandemonium ensues. Etc. (It's not a blocker bug, but it is so completely annoying!)

Change History (7)

#1 @miqrogroove
7 years ago

  • Version changed from 3.5.1 to 3.4.2

Tested and confirmed on 3.4.2 as well.

#2 follow-up: @SergeyBiryukov
7 years ago

The new page gets cached at the "wrong" URL before any changes can be made.

Could you clarify this part? When I follow those steps, the post slug is indeed updated after clicking Publish, but I don't see any problems with the new URL (and View Post button is only available with that new URL).

Or are you suggesting to never update the slug automatically after the first autosave?

#3 in reply to: ↑ 2 @miqrogroove
7 years ago

The point about caching is merely plugin related. The bug is in core and the cache will follow whatever core says is the Permalink.

Replying to SergeyBiryukov:

The post slug is indeed updated after clicking Publish

That makes no sense.

Are you suggesting to never update the slug automatically after the first autosave?

Autosave updates are fine. Making unwanted changes to a post after the user publishes it is stupid.

#4 @miqrogroove
7 years ago

Let me expand on that one more step. There is probably a corner case where if the slug is NULL then it needs to be regenerated during publication. Otherwise, the user is expecting the displayed Permalink to be the correct one.

#5 @nacin
6 years ago

  • Component changed from General to Permalinks

#6 @miqrogroove
5 years ago

WP did it to me again. I know I clicked the Preview button several times. Probably never used the Save button because the editor was auto saving just fine. Then I hit the Publish button and BOOM -- the slug that I had already customized got totally mangled because I had edited the title a few times afterward.

#7 @miqrogroove
5 years ago

  • Severity changed from major to critical

Increasing severity to Critical because the editor is actually losing the slug input if you try to customize the slug before publishing.

Note: See TracTickets for help on using tickets.