Skip to:
Content

BuddyPress.org

Opened 5 years ago

Last modified 5 years ago

#5774 new defect (bug)

Groups no-count

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

Description

Hi,

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 5 years ago.

Download all attachments as: .zip

Change History (4)

#1 @imath
5 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.

@imath
5 years ago

#2 @boonebgorges
5 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
5 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.