Skip to:
Content

BuddyPress.org

Opened 5 years ago

Closed 5 years ago

#8269 closed defect (bug) (fixed)

Member Directory nav tab Won’t Display over 999 member count

Reported by: twmcmahan's profile twmcmahan Owned by: imath's profile imath
Milestone: 6.0.0 Priority: normal
Severity: normal Version: 5.0.0
Component: Templates Keywords: has-patch
Cc:

Description

We have 3,078 Members. When opening the member directory the pagination count(s) is correct, but the count in the tab navigation is 3.

I’ve resolved this by making a change to the function bp_nouveau_get_nav_count()

/bp-templates/bp-nouveau/includes/template.tags.php Line 1266
From:

<?php
$count = (int) $nav_item->count;

to

<?php
$count = (int) str_replace(',', '', $nav_item->count );

It appears that $nav_item->count returns 3,078 and because it’s being forced to an integer it’s only returning 3 as the code is written.

Attachments (1)

8269.patch (1021 bytes) - added by imath 5 years ago.

Download all attachments as: .zip

Change History (5)

#1 @imath
5 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 6.0.0

Hi @twmcmahan

Thanks for reporting this issue. I will look at it asap to try to find a fix.

This ticket was mentioned in Slack in #buddypress by vapvarun. View the logs.


5 years ago

@imath
5 years ago

#3 @imath
5 years ago

  • Keywords has-patch added; needs-patch removed

I confirm, the reason of this issue is we're applying twice the number_format_i18n() function. Once in bp_core_number_format() and another time into bp_nouveau_nav_count(). That's one too much. 8269.patch is removing the first one to format just before output.

#4 @imath
5 years ago

  • Owner set to imath
  • Resolution set to fixed
  • Status changed from new to closed

In 12619:

BP Nouveau: make sure to format the total members count once only

Props twmcmahan

Fixes #8269

Note: See TracTickets for help on using tickets.