#2789 closed defect (bug) (fixed)
Cannot delete original default categories
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | major | Version: | 2.0.4 |
Component: | Administration | Keywords: | delete category has-patch |
Focuses: | Cc: |
Description
When trying to delete the default category Uncategorized, I receive a message saying:
Processing data...
but nothing follows. I had set another category (Everything) as the default. I tried to delete a 3rd category, and instead of its contents going to Everything, it went to Uncategorized. Apparently setting the default category ONLY affects the Category checkboxes on the Write Post page. Others have had a similar report trying to delete the Blogroll link category. I have been able to amass evidence from several posts, contained in these threads:
http://wordpress.org/support/topic/3655?replies=4#post-21653
http://wordpress.org/support/topic/65555?replies=4
http://wordpress.org/support/topic/66013?replies=4
While many recommend a workaround, it is basically, "don't do what you're trying to do", and isn't really acceptable. What if you want to transfer posts from one category to another, by deleting one and setting another to the default, as I tried to above? The system behavior (moving posts to the original default of Uncategorized, instead of the current default) is completely contrary to the user messages, leading to data corruption/pollution. The ability to batch modify posts in the admin panel would allow you to correct the damage, but that feature does not exist.
The message that displays the category that posts will be moved to is part of the problem. I have tracked that down that change:
http://trac.wordpress.org/changeset/3672
NOTE: my version is actually 2.0.3, which isn't an option below.
Good luck!
Attachments (4)
Change History (18)
#3
@
19 years ago
- Keywords bg|needs-patch added; bg|dev-feedback removed
- Owner changed from anonymous to westi
- Status changed from new to assigned
We also need to patch admin-db.php to fix "wp_delete_category" which referrers to cat_ID 1 as the default category still.
That should then fix this for 2.0.4 :-)
I'll knock up a patch later if someone doesn't beat me to it.
#4
@
19 years ago
- Keywords bg|has-patch added; bg|needs-patch removed
The attached patch backports the changes from trunk to 2.0.4 for this including the belt and braces in categories.php
#5
@
19 years ago
Hmm I'm not sure this patch completely addresses the problems here.
I have just checked my test blog again and the posts have not been moved to the default category :-(
#6
@
19 years ago
Yep wp_delete_category is still broken:
$wpdb->query("UPDATE $wpdb->post2cat SET category_id='1' WHERE category_id='$cat_ID'");
New patch incoming
#8
@
19 years ago
I noticed while fixing #2806 that you can attempt to delete the default link cat too.
Extend this patch to cover that as well.
#10
@
19 years ago
- Milestone changed from 2.0.4 to 2.1
- Resolution fixed deleted
- Status changed from closed to reopened
- Version changed from 2.0.2 to 2.0.4
This patch does not seem to be 100% .
In Wordpress 2.0.4 you still cant delete the Blogroll Link Category. You do not get an error message and all you see on the screen is "Processing Data..." .
So either you need to display the error saying you can not delete the default category or fix it so you can. I hope you allow the second option in this case. ;)
#12
@
19 years ago
- Keywords has-patch added; bg|has-patch removed
- Milestone changed from 2.1 to 2.0.5
We need to make sure we don't show the delete link for the default cat in 2.0.5
That changeset is on trunk not the 2.0 branch and was never applied to 2.0.3 so cannot be the issue here.
However some of the fixes made on trunk may be missing for 2.0.3 in this area.