[buddypress-trac] [BuddyPress Trac] #6813: Count & no-count classes not working properly for Groups

buddypress-trac noreply at wordpress.org
Fri Jan 8 21:20:53 UTC 2016

#6813: Count & no-count classes not working properly for Groups
 Reporter:  wp_new_user         |       Owner:
     Type:  defect (bug)        |      Status:  new
 Priority:  normal              |   Milestone:  2.5
Component:  Component - Groups  |     Version:  2.4.0
 Severity:  normal              |  Resolution:
 Keywords:                      |
Changes (by boonebgorges):

 * component:  API => Component - Groups
 * milestone:  Awaiting Review => 2.5


 The 'count' and 'no-count' classes were introduced in [7758].

 The problem is that the check is strict `0 === $count`, but `$count` is a
 string. As far as I can see, this issue has always existed.
 `bp_get_total_group_count_for_user()`, `groups_total_groups_for_user()`,
 and `BP_Groups_Member::total_group_count()` all claim in their
 documentation to return integers, but none of them do.

 There's a possibility for some breakage, but I recommend we fix this by
 casting the return values of all of these functions to integers. (We have
 to do all of them because of the filters and cache support.) I'm going to
 make the change and see if anyone complains about it :)

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6813#comment:2>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list