Ticket #6072 (closed defect: fixed)

Opened 9 months ago

Last modified 9 months ago

Write Post: Permalink should not be "undefined" if I click Edit, clear the field, and then click Save

Reported by: lloydbudd Assigned to: nbachiyski
Priority: normal Milestone: 2.5
Component: General Version: 2.5
Severity: normal Keywords: has-patch
Cc:

Description

Write Post: Permalink should not be "undefined" if I click Edit, clear the field, and then click Save

ENV: WP trunk r7133 (2.5-beta1)

The result is Permalink: http://example.com/undefined/ [Edit]

But it doesn't actually save any change thankfully.

The expectation is that a new permalink is created based on the current post title.

ADDITIONAL DETAIL

Specifically, after publishing a post. I decide I want to change the title, and I want the URL to be updated as well. That is where my expectation comes from, and previous versions of WP worked in this manner.

Attachments

act-right-on-empty-slug.diff (3.1 kB) - added by nbachiyski on 03/03/08 16:47:40.
really-act-right-on-empty-slug.diff (2.5 kB) - added by nbachiyski on 03/05/08 08:00:30.

Change History

03/03/08 16:47:40 changed by nbachiyski

  • attachment act-right-on-empty-slug.diff added.

03/03/08 16:47:47 changed by nbachiyski

  • keywords set to has-patch.

Lloyd, I totally agree. The patch hopefully meets these expectations.

03/03/08 21:02:53 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [7139]) Slug edit fix from nbachiyski. fixes #6072

03/04/08 23:02:29 changed by ryan

  • status changed from closed to reopened.
  • resolution deleted.

This causes draft permalinks to show the post ID instead of the slug.

03/05/08 08:00:11 changed by nbachiyski

The main problem was that autosave didn't pass the title, so that the correct slug can be computed. Moreover, I had some stupid holes in the logic.

Tested in the following conditions:

  • New post -> Automatic autosave -- uses the title at the moment of autosave
  • Draft -> Edit slug
  • Draft -> Edit slug and then save -- there was a problem in that case (used empty slug), which I found and fixed
  • Published post -> Set a new slug
  • Any post -> Set empty slug -- fallbacks to current title as Lloyd suggested

03/05/08 08:00:30 changed by nbachiyski

  • attachment really-act-right-on-empty-slug.diff added.

03/05/08 22:09:53 changed by markjaquith

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [7162]) Post slug fixes from nbachiyski. fixes #6072