Make WordPress Core

Opened 13 years ago

Closed 11 years ago

#1757 closed defect (bug) (fixed)

Category caculation not right

Reported by: Melodiefabrieknl Owned by: rob1n
Milestone: 2.2 Priority: normal
Severity: normal Version: 1.5.2
Component: Administration Keywords:
Focuses: Cc:


On my site I have this subcategory 'Propellerhead Reason' showing it contains 29 posts. If I check the Admin-page (Manage-Categories) it states 30 posts!

This seems to be a bug. Are the developers aware of it?

Attachments (1)

bug1757.diff (1.3 KB) - added by graeme 13 years ago.

Download all attachments as: .zip

Change History (8)

#1 @graeme
13 years ago

  • Owner changed from anonymous to graeme

The problem here seems to be that the admin page and the list_cats function are counting posts using different methods. list_cats is using joins to eliminate pages from inclusion, the admin page is not. For some reason pages are filed as having a category ID as one. This seems to be an desing flaw in pages.

I will attach a patch that makes the admin page list the number of posts in a category in the same way as list_cats, but the real problem is that pages really shouldn't have a category at all.

#2 @graeme
13 years ago

Done, by matching against post_status. It might be possible to do it cleaner -- I don't really understand joins.

13 years ago

#3 @graeme
13 years ago

  • Keywords bg|2nd-opinion added; calculation bug categories category removed

#4 @graeme
13 years ago

  • Keywords bg|has-patch added

#5 @rob1n
11 years ago

  • Keywords bg|2nd-opinion bg|has-patch removed
  • Owner changed from graeme to rob1n
  • Status changed from new to assigned

#6 @foolswisdom
11 years ago

  • Milestone set to 2.2
  • Priority changed from high to normal

#7 @johnbillion
11 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

Closing as fixed. Function list_cats has been deprecated and replaced by wp_list_categories. Category count is now correct.

Note: See TracTickets for help on using tickets.