I’m sure this won’t help, but just out of curiosity are you on the latest version of WordPress/bbPress?
It’s quite strange. I forced 1.000.000 on bbp_get_topic_pagination with no luck. A “find . -name ‘*.php’ | xargs grep 1000” didn’t show the value hardcoded anywhere.
My guess is the number is being formatted when it shouldn’t be, putting a comma after the 1, resulting in a string where it’s expecting an integer.
Hello John, thank you for your reply. It sounds logical that this could be the reason, but we can’t find an option to change the number format (for example from 2,033 to 2033). We have searched all the options in BBpress and WordPress but we could not find it.
Could you give us more info, how to change it?
Thank you in advance.
-
This reply was modified 12 years, 2 months ago by matrixd.
Hello again, finally after John’s helpful tip, I was able to fix the issue. I found where BBpress does the number formatting and disabled it. In wp-content/plugins/bbpress/bbp-includes/bbp-common-functions.php I changed this line:
function bbp_number_format( $number = 0, $decimals = false, $dec_point = '.', $thousands_sep = ',' ) {
to:
function bbp_number_format( $number = 0, $decimals = false, $dec_point = '.', $thousands_sep = '' ) {
This removes the comma from the thousands separator. No all topics pages appear correctly. Thanks!
-
This reply was modified 12 years, 2 months ago by matrixd.
-
This reply was modified 12 years, 2 months ago by matrixd.
Filed a bug report in trac – https://bbpress.trac.wordpress.org/ticket/1974
Will hopefully get a patch soon have this fixed for 2.2 🙂
Thanks for reporting the bug!
That fixes one issue, and breaks everything else. 🙂
So far everything appears to be OK for us, we only need to remember to apply the fix again after every BBpress upgrade until it is fixed officially.
Also just to mention that this bug could occur only on European forums? I noticed something that made me think so: In Greece and most European countries we use the comma (,) as a decimal separator, actually what was happening, it was interpreting 2,033 as 2 replies.
We found that in discussions with 27,300 and 30,156 replies it was displaying 2 pages, because it was interpreting 27,300 to 27 replies and 30,156 to 30
-
This reply was modified 12 years, 2 months ago by matrixd.
/wp-content/plugins/bbpress/bbp-includes/bbp-topic-template.php line 686:
$total = bbp_get_topic_reply_count( $topic_id );
this is erroneous because of this:
/wp-content/plugins/bbpress/bbp-includes/bbp-core-filters.php line 158:
add_filter('bbp_get_topic_reply_count', 'bbp_number_format', 10);
Actually speaking bbp_get_user_topic_count, bbp_get_user_reply_count, bbp_get_user_post_count, bbp_get_forum_subforum_count, bbp_get_forum_topic_count, bbp_get_forum_reply_count, bbp_get_forum_post_count, bbp_get_topic_voice_count, bbp_get_topic_reply_count and bbp_get_topic_post_count are all affected by this bug.
I suggest to insert an additional filter on all the functions described above. This is an example for bbp_get_topic_reply_count: https://gist.github.com/3884515
All the functions that ‘echo’ values are used on templates and it’s the best place where to put a cosmetic filter like number_format.