Skip to:
Content

bbPress.org

Opened 6 years ago

Closed 5 years ago

#2556 closed defect (fixed)

Topics with 1000+ replies do not show page numbers

Reported by: tharsheblows Owned by: johnjamesjacoby
Milestone: 2.6 Priority: high
Severity: major Version: 2.0
Component: Component - Replies Keywords:
Cc:

Description

This is a follow-up to #1974.

I'm writing this while I still remember - apologies for scatterbrainedness. This is on the latest version of bbPress, 2.5.3, unless you've released an update after the 3rd March.

I had the exact same problem as in #1974. The issue was that it was inserting 2 for menu_order in wp_posts after 1000 replies. In includes/common/functions.php I've done the same thing as here - http://bbpress.org/forums/topic/topics-with-more-than-1000-replies-not-showing-page-numbers/ changing this:

function bbp_number_format( $number = 0, $decimals = false, $dec_point = '.', $thousands_sep = ',' ) 

to this:

function bbp_number_format( $number = 0, $decimals = false, $dec_point = '.', $thousands_sep = '' ) 

So that worked but didn't update the older menu_order entries in wp_posts of course, so the older permalinks are still broken due to the incorrect menu_order. I just haven't gotten to that but think I'll do something with a little plugin using bbp_update_reply_position(). That might not work - it just hasn't been an urgent issue (ie no one's noticed the incorrect permalinks yet).

Anyway, I fixed the front end formatting by doing this sort of thing (this is in the loop-single-topic template):

<?php $topic_reply_count = bbp_get_topic_reply_count();
           $topic_post_count = bbp_get_topic_post_count(); ?>

<li class="bbp-topic-reply-count"><p class="entry-meta"><?php echo bbp_show_lead_topic() ? number_format( $topic_reply_count ) : number_format( $topic_post_count ); ?></p></li>

which of course would be better to do in, eg, the bbp_topic_reply function but I didn't want to edit the core plugin files more.

Attachments (1)

mjj-bbp-menu-order-update.php (2.7 KB) - added by tharsheblows 6 years ago.
this is what I used to recalculate the menu order so the permalinks wrote correctly

Download all attachments as: .zip

Change History (4)

@tharsheblows
6 years ago

this is what I used to recalculate the menu order so the permalinks wrote correctly

#1 @tharsheblows
6 years ago

It comes under "tools" in the admin section and just uses the topic id (which by this point I knew by heart) - I would have added it to the list in includes/admin/tools.php but again I didn't want to overwrite the core.

#2 @johnjamesjacoby
5 years ago

  • Component changed from General to Replies
  • Milestone changed from Awaiting Review to 2.6
  • Priority changed from normal to high
  • Severity changed from normal to major
  • Version set to 2.0

#3 @johnjamesjacoby
5 years ago

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

In 5338:

When calculating a new reply position, ensure we are using raw, unformatted integers. Fixes bug where formatted numeric strings (I.E. with commas; eg: 1,532) were being passed to the menu_order property, causing broken pagination on topics with over 1k replies. Fixes #2556.

Note: See TracTickets for help on using tickets.