Skip to:
Content

Opened 2 years ago

Closed 2 years ago

#3044 closed defect (duplicate)

"menu_order" breaks for topics with more than 1,000 replies

Reported by: wpdennis Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Component - Replies Keywords: dev-feedback
Cc: info@…

Description

While inserting a new reply in bbp_new_reply_handler() the 'menu_order' is defined by:

'menu_order'     => bbp_get_topic_reply_count( $topic_id, false ) + 1

With $integer = false this will trigger bbp_number_format() and will return a formatted number. With more than 1,000 replies you'll get something like "1,012" which results as 'menu_order' = 2 in my database.

This leads to defect freshness links, since bbp_get_reply_position() will return wrong values.

Handling the menu_order as an integer solved this issue for me:

'menu_order'     => bbp_get_topic_reply_count( $topic_id, true) + 1

Change History (1)

#1 @johnjamesjacoby
2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hey @wpdennis! Thanks for noticing this. Looks like we've already fixed this for 2.6 in #2556 and #2615.

If you're able, give the 2.6 beta try!

https://bbpress.org/forums/topic/bbpress-2-6-beta/

Note: See TracTickets for help on using tickets.