#3460 closed defect (bug) (wontfix)
Duplicated default category after deleting a category
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.0.5 |
Component: | Administration | Keywords: | category |
Focuses: | Cc: |
Description
If a category is deleted, all the posts under it will be assigned the default category.
A better approach is checking if it has been assigned another category. If yes, don't apply the default category - that's meaningless.
A real bug is, if the post was assigned both the deleted category and the default, the default will be assigned once more, resulting in two identical rows (except rel_id column) in the wp_post2cat table. Also the fix is adding a check, but following the approach above will avoid such situation.
Attachments (1)
Change History (7)
#1
@
18 years ago
- Milestone changed from 2.1 to 2.0.7
- Owner changed from anonymous to markjaquith
- Status changed from new to assigned
#3
@
18 years ago
The functions used to do it in 2.1 (wp_get_post_categories()
and wp_set_post_categories()
don't exist in 2.0.x
I've attached a patch that should do the equivalent in 2.0.x, but I'd like to save it for another milestone. It's not quite ideal, because it causes one query per post that existed in the category you're deleting.
This has been fixed for 2.1
Possible 2.0.7 milestone.
Here is the 2.1 code, for reference: