Skip to:
Content

Opened 4 years ago

Last modified 3 years ago

#5608 new defect (bug)

Improve "Blog Comments" activity filter

Reported by: boonebgorges 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)

#1 @DJPaul
4 years ago

  • Priority changed from normal to highest

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

#2 @boonebgorges
4 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.

#3 @boonebgorges
4 years ago

In 8747:

Ensure that the 'Comments' dropdown filter on the activity directory includes new- and old-style comment activity

The change in BuddyPress 2.0 to storing blog comment activity in
activity_comment items resulted in the 'Comments' dropdown filter breaking: it
continued to return only 'new_blog_comment' items. This changeset introduces
a number of filters to ensure that both the appropriate 'activity_comment'
and 'new_blog_comment' items are included when passing 'action=new_blog_comment'
to bp_has_activities().

See #5608

#4 @DJPaul
4 years ago

Nice, thanks for working on this.

#5 @boonebgorges
4 years ago

  • Milestone changed from 2.1 to 2.2

#6 @r-a-y
4 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.

#7 @DJPaul
4 years ago

  • Milestone changed from 2.2 to 2.3

#8 @DJPaul
3 years ago

  • Milestone changed from 2.3 to Future Release
Note: See TracTickets for help on using tickets.