[buddypress-trac] [BuddyPress] #1991: bp_has_members - can't set unlimited per_page

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Mon May 2 22:13:08 UTC 2011

#1991: bp_has_members - can't set unlimited per_page
  Reporter:  DJPaul  |      Owner:
      Type:  defect  |     Status:  reopened
  Priority:  major   |  Milestone:  1.3
 Component:  Core    |    Version:
Resolution:          |   Keywords:  has-patch
Changes (by boonebgorges):

 * keywords:   => has-patch
 * priority:  minor => major
 * status:  closed => reopened
 * resolution:  fixed =>


 I'm reopening this ticket. Paul, your fix meant that the $limit param of
 BP_Core_User::get_users() was never null. And the default value of $page
 is set to 1. That means that, in some places where no pagination data at
 all is passed to bp_has_members(), you end up with $limit = 1 and $page =
 1, meaning that a single member is returned. (This happens, for instance,
 in the friends list that appears on the Send Invites tab of groups.)

 I have attached what seems like a safer fix, namely one that casts $limit
 as an integer, so that the $limit check that you refer to is actually
 respected when a value of 0 is passed.

 I'd like a second opinion about this before committing, because this
 touches a lot of stuff throughout BP. But I've been staring at it for
 about an hour and I'm reasonably sure that this is the solution :)

Ticket URL: <https://trac.buddypress.org/ticket/1991#comment:3>
BuddyPress <http://buddypress.org/>

More information about the buddypress-trac mailing list