[buddypress-trac] [BuddyPress Trac] #7309: Activity: related activity_comments are missing from custom post type comment query
buddypress-trac
noreply at wordpress.org
Thu Oct 27 16:16:21 UTC 2016
#7309: Activity: related activity_comments are missing from custom post type
comment query
--------------------------+-----------------------------
Reporter: Offereins | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Activity | Version:
Severity: normal | Keywords:
--------------------------+-----------------------------
=== Context ===
Currently, custom post type comments can be registered as activities in
the db in two ways:
* when `bp_disable_blogforum_comments()`: original comment at the post >
`new_{$post_type}_comment`.
* else: either as activity comment in the activity stream or as original
post comment > `activity_comment` regardless of the post's post type.
When `bp_disable_blogforum_comments()` is false, meaning activity post
commenting is enabled, the query for fetching the post type's comment
activities queries for either for the activity type
`new_{$post_type}_comment` or the specific activity IDs (in case they were
created with type `activity_comment`) - see
`bp_blogs_new_blog_comment_query_backpat()`.
=== Issue ===
However, when `bp_disable_blogforum_commments()` returns true, the comment
activity query only queries for the `new_{$post_type}_comment` activity
types, ignoring the comments that may have been made in the activity
stream previously, sitting in the db as `activity_comment`. These comments
do live with their posts and have been recorded as activity, but are now
not included in the list of post type comment activities. It is true that
activity comments cannot be created with this condition, but there may be
entries in the db from before that setting.
=== Solution ===
I suggest to alter the query for custom post type comments under
`bp_disable_blogforum_comments()` to include activities that have been
made as `activity_comment`. For this, we can use the logic presented in
the mentioned `bp_blogs_new_blog_comment_query_backpat()` where specific
IDs that have the meta_key `bp_blogs_new_{$post_type}_comment_id` are
queried prior to setting the activity query arguments.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7309>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list