[buddypress-trac] [BuddyPress Trac] #6645: `BP_Activity_Activity::get()` args should be translated into `BP_Activity_Query`

buddypress-trac noreply at wordpress.org
Wed Oct 7 02:48:28 UTC 2015


#6645: `BP_Activity_Activity::get()` args should be translated into
`BP_Activity_Query`
----------------------------------+-----------------------------
 Reporter:  boonebgorges          |       Owner:
     Type:  enhancement           |      Status:  new
 Priority:  normal                |   Milestone:  Future Release
Component:  Component - Activity  |     Version:
 Severity:  normal                |  Resolution:
 Keywords:  has-patch             |
----------------------------------+-----------------------------

Comment (by r-a-y):

 > I definitely think your patch is an improvement, though it still
 requires filtering where_conditions to drop the 'scope' clause if you want
 filter_array to work in an unfettered way.

 You can also drop `'scope'` further up in the
 `'bp_after_has_activities_parse_args'` filter without the patch to
 accomplish what you need.  Though, I see what you mean.

 > What if scope were translated into a filter_query somewhere further up
 the stack - say, in bp_activity_get() or bp_has_activities()?

 Now, there's a thought!  The only problem is a scope needs to override the
 various default activity parameters.  In order to move this up the stack,
 we might need to change a few parameters since our parameters are not
 named the same across the template/get functions and class.

 > I guess this is all coming from a strong dislike for 'scope'. It's a
 black box that hides a lot of complexity and assumptions. Unraveling them
 systematically so that they can be modified in a filter often means
 reverse-engineering what the various values of 'scope' are intended to do.
 'user_id', 'item_id', 'hide_sitewide', and even 'filter_query' can easily
 be parsed programatically. 'scope' is opaque, and depends on context. I'd
 be happy if it were never passed to a low-level function or filter.

 Yeah, I hear ya.  When it comes to plugins needing to modify the scope, it
 ''is'' painful.  Having needing to use these filters myself, you're not
 the only one experiencing these growing pains!

 Conversely, `'filter_query'` is just as painful in my eyes.  With the
 scope filters, at least you can pinpoint what might need to be changed in
 a given scope.

 > I won't beat the drum for much longer :)

 Please continue in the spirit of Todd Rundgren :)  I think this discussion
 is useful and I do think converting `'scope'` back to `'filter_query'` is
 an approach worth exploring.  If there's time in 2.4, let's strive for it,
 but 2.5 might be better.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6645#comment:3>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list