Skip to:
Content

bbPress.org

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#3124 closed defect (bug) (fixed)

User's topic/reply count functions can return false instead of an integer

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: johnjamesjacoby's profile johnjamesjacoby
Milestone: 2.6 Priority: normal
Severity: normal Version:
Component: Component - Users Keywords: commit
Cc:

Description

The following functions are supposed to always return an integer, but can return false if the passed $user_id is empty:

  • bbp_get_user_topic_count_raw()
  • bbp_get_user_reply_count_raw()
  • bbp_get_user_closed_topic_count()

Either the functions should be changed to always return an integer (to match what @return says), or false should be documented as another possible @return value.

Change History (3)

#1 @johnjamesjacoby
7 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 2.6

Good call. I've been meaning to get rid of the count_user_posts() usages anyways, because they're ineffective for our use case (multiple statuses, etc...)

#2 @johnjamesjacoby
7 years ago

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

In 6609:

Counts: Remove count_user_posts() usages, and always return an int.

User topic & reply counts haven't included closed status for topics, and these wrappers should include support for things like view=all later.

Fixes #3124.

#3 @SergeyBiryukov
7 years ago

In 6610:

Counts: Fix typo in DB query in bbp_get_user_reply_count_raw().

See #3124.

Note: See TracTickets for help on using tickets.