Opened 17 years ago
Closed 17 years ago
#6072 closed defect (bug) (fixed)
Write Post: Permalink should not be "undefined" if I click Edit, clear the field, and then click Save
Reported by: | lloydbudd | Owned by: | nbachiyski |
---|---|---|---|
Milestone: | 2.5 | Priority: | normal |
Severity: | normal | Version: | 2.5 |
Component: | General | Keywords: | has-patch |
Focuses: | 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 (2)
Change History (7)
#3
@
17 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
This causes draft permalinks to show the post ID instead of the slug.
#4
@
17 years ago
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
Lloyd, I totally agree. The patch hopefully meets these expectations.