Skip to:
Content

BuddyPress.org

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#5228 closed defect (bug) (fixed)

Wrong total members count due to number_format_i18n

Reported by: sgr33n's profile sgr33n Owned by: boonebgorges's profile boonebgorges
Milestone: 1.9 Priority: normal
Severity: normal Version:
Component: Core Keywords: needs-patch reporter-feedback
Cc:

Description

number_format_i18n doesn't work as it should on bp-members-template.php on line 347.

I'm using the italian internationalization and I have 8916 members in the database, so 8916 becomes 8.916, then (maybe there is an (int) filter) becomes 9... so it displays a total of 9 members.

To fix remove number_format_i18n on the lines 347, 349, 351, 353.

Attachments (1)

dots.jpg (107.4 KB) - added by sgr33n 11 years ago.

Download all attachments as: .zip

Change History (11)

#1 @DJPaul
11 years ago

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

Yep. Not sure why we have our own bp_core_number_format as it doesn't add much value, but that just uses number_format_i18n.

#2 @boonebgorges
11 years ago

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

In 7513:

Don't double number-format directory pagination counts

By running total item counts through number_format_i18n() twice, certain
number formats were getting messed up.

Fixes #5228

Props sgr33n

#3 @sgr33n
11 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Good :) but I updated to svn 7515 and even if on members page the total count is now correct, there are still wrong counts, like on activity page .activity-type-tabs role="navigation" :(

#4 @boonebgorges
11 years ago

  • Keywords reporter-feedback added; has-patch removed

there are still wrong counts

Could you give a list of the places where you see incorrect counts?

#5 @sgr33n
11 years ago

Seems that the only left was the one on activity page, but I cannot test with groups because I don't have many... then I'm realising that for groups there is no count transient value stored on options table like for members.

#6 @boonebgorges
11 years ago

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

In 7516:

Don't auto-format bp_get_total_member_count()

Filtering the output of bp_get_total_member_count() meant that the value was
double-encoded in some places, causing problems for certain locales and certain
numbers. Since number formatting is a display-related issue, we rely on the
template to do the number formatting, and leave the the output of
bp_get_total_member_count() in its raw form.

Fixes #5228

#7 @sgr33n
11 years ago

Good :) thanks!

@sgr33n
11 years ago

#8 @sgr33n
11 years ago

Sorry for replying again here, but I guess that I should report that the new behavior is not unique at the moment. There are places where the number is formatted, and places where not. I will attach a screenshot: the first one is the the activity page, the second one the users. In my theme the sidebar on the left side is the subnav.

Last edited 11 years ago by sgr33n (previous) (diff)

#9 @boonebgorges
11 years ago

sgr33n - That appears to be a separate issue, one where number format *is not* being applied. If you could start a new ticket, with a list of places where you see the issue, that'd be great. Thanks.

#10 @boonebgorges
11 years ago

In 7520:

Improvements to i18n number formatting in activity count functions/templates

This changeset makes number formatting more consistent in the activity
templates of bp-legacy. The logic is as follows:

  • Move all number formatting out of the templates and into the relevant -template.php file.
  • Add number formatting to those _count() template functions that were missing it.
  • Clean up sprintf() swapping arguments to account for string vs int number formats

See #4997, #5228

Fixes #5231

Note: See TracTickets for help on using tickets.