[buddypress-trac] [BuddyPress Trac] #6059: BP_Activity_Activity:get() doesn't respect 'max' parameter

buddypress-trac noreply at wordpress.org
Mon Dec 8 19:15:40 UTC 2014


#6059: BP_Activity_Activity:get() doesn't respect 'max' parameter
--------------------------+-----------------------------
 Reporter:  dcavins       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Activity      |    Version:
 Severity:  minor         |   Keywords:
--------------------------+-----------------------------
 `BP_Activity_Activity:get()` accepts three SQL limit parameters: `$page`,
 `$per_page` and `$max`. `$page` and `$per_page` are used to generate
 pagination SQL, but `$max` is only used to modify the found-row count.

 It seems that at the least we'd have to decide that `$page` and
 `$per_page` trump `$max` or vice-versa. Both can't be used in the same
 request.

 One minimal option would be to set `$page = 1` and `$per_page = $max` if
 `$args['max']` is set (and `$args['per_page']` is not set) at about line
 473 and leave the pagination logic in place.

 Source:
 https://buddypress.trac.wordpress.org/browser/trunk/src/bp-activity/bp-
 activity-classes.php#L296

 I'll happily produce a patch if we can decide on the desired behavior.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6059>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list