[buddypress-trac] [BuddyPress Trac] #5608: Improve "Blog Comments" activity filter

buddypress-trac noreply at wordpress.org
Fri Aug 1 19:49:58 UTC 2014


#5608: Improve "Blog Comments" activity filter
--------------------------+------------------
 Reporter:  boonebgorges  |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  highest       |   Milestone:  2.1
Component:  Activity      |     Version:  2.0
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------

Comment (by boonebgorges):

 > This seems a pretty serious regression we should fix for 2.1.

 Agreed.

 I've spent a bunch of time with it. The desired logic is something like
 this:

 {{{
 SELECT a.id WHERE (
     ( it's an activity_comment that also has 'bp_blogs_post_comment_id' )
     OR
     ( it's a new_blog_comment )
 )
 }}}

 The problem is that our query logic does not allow for this kind of
 complex query: we can't do complex ORs, and we can't match a `meta_query`
 only against part of the WHERE clauses.

 In some ideal world, we would allow for this kind of sophisticated
 filtering at the level of the `bp_has_activities()` API (though tbh I'm
 not even sure what the syntax would look like). But for now, the only way
 we can really do this is by splitting the query into some manual OR
 clauses that use a subquery. I've decided to do it this way because it
 allows the logic to be abstracted into the blogs component, as r-a-y's
 patch
 https://buddypress.trac.wordpress.org/attachment/ticket/5560/5560.01.patch
 originally suggested.

 It probably will not scale very well on very large installations. And we
 should probably rethink the way the Activity filter dropdown works, so
 that the Comments filter does 'activity_comment' querying *by default* and
 we tack on 'new_blog_comment' as an afterthought, rather than the other
 way around. But, for now, my fix addresses the regression, so I'm going to
 go with it for 2.1. I'll then move the ticket to 2.2 for a broader
 refactoring of the activity filters.

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


More information about the buddypress-trac mailing list