Skip to:

Opened 9 years ago

Last modified 9 years ago

#5774 new defect (bug)

Groups no-count

Reported by: sgr33n's profile SGr33n Owned by:
Milestone: Awaiting Contributions Priority: normal
Severity: normal Version: 2.0
Component: Groups Keywords: needs-testing needs-patch



On the user profile page, even if he/she have no groups, the count bubble class is count (should be no-count).

Attachments (1)

5774.patch (650 bytes) - added by imath 9 years ago.

Download all attachments as: .zip

Change History (4)

#1 @imath
9 years ago

  • Component changed from Core to Groups
  • Keywords has-patch added
  • Version set to 2.0

Hi SGr33n

Thanks for your feedback. Suggesting 5774.patch.

9 years ago

#2 @boonebgorges
9 years ago

  • Keywords needs-refresh needs-testing added; has-patch removed

There's some double formatting happening here. bp_get_total_group_count_for_user() is run through bp_core_number_format(). Your patch then strips the formatting, only to re-add it on line 333. This won't work right, because I believe intval() does not properly handle commas (as in "1,000 groups"). I suggest something like the following:

$count = bp_get_total_group_count_for_user();
$class = 0 === intval( groups_total_group_for_user() ) ? 'no-count' : 'count';
$nav_name = sprintf( __( 'Groups <span class="%s">%s</span>', 'buddypress' ), esc_attr( $class ), $count ); 

This could probably use some testing, and probably needs to happen across all components too.

#3 @DJPaul
9 years ago

  • Keywords needs-patch added; needs-refresh removed
  • Milestone changed from Awaiting Review to Future Release
Note: See TracTickets for help on using tickets.