#6083 closed defect (bug) (fixed)
Post url preview messed up.
Reported by: | Nightgunner5 | Owned by: | |
---|---|---|---|
Milestone: | 2.5 | Priority: | normal |
Severity: | normal | Version: | 2.5 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
==What happened?==
I was typing a test post to demo the new position of the autosave, when I noticed that the url of the post (as it autosaved) was not shown correctly according to my settings. (See attachment)
My permalink settings are /%category%/%post_id%/%postname%/, but it showed %post_id%/%post_id%/, even though I had typed in a title well before it autosaved. I did not choose a category.
==Environment==
wp trunk r7145
FireFox 2.0.0.12
Windows XP Media
==What should be done?==
When a post autosaves for the first time, the default category should be ajax'd into the category selection meta box and the permalink preview. It should also figure out the post slug.
Attachments (3)
Change History (12)
#2
@
16 years ago
In case of missing categories the default one is used, but it is set on the first real save. Here is a patch, which users the default category if on autosave there were none of them.
#3
@
16 years ago
Having autosave assign the default category is rather annoying. Can we do this in the sample permalink code somehow?
#4
@
16 years ago
That was the first thing I tried -- get_permalink
uses get_the_category
, in which I couldn't find an easy way to add a filter.
Anyway, the category is set, but it doesn't check the default category checkbox, so I guess it is annoying in code point of view?
#5
@
16 years ago
My concern is with the post getting the default category when the user hasn't asked for the default category. We usually don't set the default category until publish time and only then if no other categories have been checked. If the old behavior is preserved, then no worries.
Could get_permalink simply use the default category if get_the_category() returns nothing?
#6
@
16 years ago
Currently the category is set on save, not on publish. That's why this patch isn't breaking the current behaviour.
I have applied patch for get_permalink
, I agree it is a better place for the change.
Also, I think it would be a good idea to push the default category only on publish and not on saving drafts. However it will need some more digging, because setting the default category is done at more than one place and I will have to see, which callers really expect it to be set.
The missing title problem is due to the patch in #6072.