Skip to:

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#2289 closed enhancement (fixed)

Topic has always posts

Reported by: pavelevap Owned by:
Milestone: 2.3 Priority: low
Severity: normal Version: 2.2.3
Component: Component - Topics Keywords:
Cc: pavelevap@…


File bbpress/includes/topics/template-tags.php (line 2998):

$last_reply = bbp_get_topic_last_active_id( $topic_id );
if ( !empty( $last_reply ) ) {

Condition will be always true, because bbp_get_topic_last_active_id() function returns ID of first topic post (even if there are no replies).

So, all other possibilities and strings will never happen.

Attachments (1)

2289.patch (414 bytes) - added by johnjamesjacoby 9 years ago.

Download all attachments as: .zip

Change History (6)

#1 @alex-ye
9 years ago

I think it's good to have a condition around, as you see bbp_get_topic_last_active_id() has a filter at the end so you can't trust what it return :)

#2 @alex-ye
9 years ago

  • Component changed from General to Topics
  • Priority changed from normal to low
  • Type changed from defect to enhancement
  • Version changed from trunk to 2.2.3

#3 @johnjamesjacoby
9 years ago

  • Milestone changed from Awaiting Review to 2.3

Should use bbp_get_topic_last_reply_id() instead.

#4 @johnjamesjacoby
9 years ago

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

(In [4834]) Fix bug in bbp_get_single_topic_description() causing some conditions to never be executed. Use bbp_get_topic_last_reply_id() instead of bbp_get_topic_last_active_id() since the $topic_id is used as the last active ID if no replies exist. Fixes #2289.

#5 @johnjamesjacoby
9 years ago

Note that in most instances, r4834 won't actually change any output. These two functions can almost be used interchangeably at this point, and the empty( $reply_id ) check in bbp_get_topic_last_reply_id() should probably be removed. Patch incoming.

Note: See TracTickets for help on using tickets.