Opened 17 years ago
Closed 16 years ago
#2359 closed defect (bug) (fixed)
Excess "Uncategorized" posts in post2cat table
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.3 | Priority: | normal |
Severity: | normal | Version: | 2.0 |
Component: | Administration | Keywords: | uncategorized posts has-patch |
Focuses: | Cc: |
Description
I notice that I have a tonne of posts categorised as "Uncategorized" (as on the Manage Categories page), even though I don't have any posts categorised as "Uncategorized" any more (and indeed when you go to my category archive for uncategorised, there's no posts either). It's bothering me since I'm using a tag cloud plugin.
I had a look in post2cat table and the phantom uncategorized posts are listed in there. To see what these actually are, I went to
wp-admin/post.php?action=edit&post=
and entered in these post ids from post2cat where category_id = 1.
I got an error, of course, since the post wasn't there but I could see the preview window showing images that I'd uploaded to those posts which were once categorized with "Uncategorized".
Any idea what's going on? I'll try and investigate further.
Attachments (1)
Change History (16)
#3
@
17 years ago
Ok, to follow up the bug is as follows:
- Create entry, categorized as "Uncategorized"
- Upload images for this entry
- Publish entry
- Delete entry
- Relevant post2cat lines are not deleted.
#4
@
17 years ago
- Resolution set to invalid
- Status changed from new to closed
If you mean:
- The post2cat line for the deleted post isn't removed, worksforme.
- The post2cat line for the attachment isn't removed, invalid. It's not meant to be. Attachments are stored as posts, so they have their own post2cat lines.
I suspect you meant the latter so I'm closing with invalid.
#6
@
17 years ago
- Resolution invalid deleted
- Status changed from closed to reopened
I was referring to the post2cat line for the attachment isn't deleted, hence the category counts are incorrect.
#7
@
17 years ago
- Milestone set to 2.1
Attachment categories are mostly unused, yes. The category counts should probably be refined to exclude Attachments.
#8
@
17 years ago
Two possible solutions to this:
- We don't create post2cat lines for attachments
- We ignore post_status="attachment" lines for the purposes of creating category counts.
Personally I think the former would be more useful as there's really no point clogging up tables with useless rows.
#12
@
17 years ago
- Keywords bg|has-patch added; bg|needs-patch removed
- Status changed from new to assigned
Here's a patch. When applied, Wordpress will not create post2cat entries for attachments. It will, however, attempt to delete post2cat entries. I thought it to be prudent to leave that in so Wordpress would clean up its mess...
Regards.
This is more of a support request, not a bug report.
http://wordpress.org/support