Opened 11 years ago
Last modified 10 years ago
#5608 new defect (bug)
Improve "Blog Comments" activity filter
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Contributions | Priority: | highest |
Severity: | normal | Version: | 2.0 |
Component: | Activity | Keywords: | |
Cc: |
Description
See #5560 for background discussion.
The blog-activity sync mechanisms introduced in BP 2.0 meant that new blog comments created activity *comments* rather than top-level activity items called 'new_blog_comment'. This has the effect of breaking the 'New Blog Comments' filter in the activity dropdown.
Several possible approaches are discussion in #5560. See https://buddypress.trac.wordpress.org/ticket/5560#comment:2 and https://buddypress.trac.wordpress.org/ticket/5560#comment:4
Let's use this ticket to figure out what to do about this issue.
Change History (8)
#2
@
11 years ago
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.
#6
@
11 years ago
Thanks for getting to this, boonebgorges.
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.
That would mean "Allow activity stream commenting on blog and forum posts" would be on by default, which isn't the case at the moment.
As a sidenote, I've been thinking about having display_comments=stream
be the default display mode for comments in the sitewide activity stream. This would solve a lot of problems with how we don't bump up the activity update when an activity comment is added to an activity thread and would fix this UX problem. (This was first mentioned in ticket:5560#comment:1 by Boone.) I'll probably open a new ticket about this.
This seems a pretty serious regression we should fix for 2.1.