WordPress.org

Make WordPress Core

Opened 3 months ago

Last modified 3 months ago

#23781 new defect (bug)

New Post Publishes to Wrong URL

Reported by: miqrogroove Owned by:
Priority: normal Milestone: Awaiting Review
Component: General Version: 3.4.2
Severity: major Keywords:
Cc:

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 (4)

comment:1 miqrogroove3 months ago

  • Version changed from 3.5.1 to 3.4.2

Tested and confirmed on 3.4.2 as well.

comment:2 follow-up: SergeyBiryukov3 months 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?

comment:3 in reply to: ↑ 2 miqrogroove3 months 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.

comment:4 miqrogroove3 months 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.

Note: See TracTickets for help on using tickets.