#5592 closed defect (bug) (no action required)
Can not retrieve a specific activity comment.
Reported by: | godavid33 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Activity | Keywords: | |
Cc: |
Description
When using bp_activity_get_specific( array( 'activity_ids' => ACTIVITY_ID ) ) with the ID of an activity_comment, a blank array is returned as the results. When using with the ID of an activity_update (or essentially anything excluding activity_comment) the correct results are returned.
This gets in the way of trying to custom create notifications front-end displays particularly.
Change History (4)
#2
@
10 years ago
- Component changed from Core to Activity
- Milestone Awaiting Review deleted
- Priority changed from high to normal
- Resolution set to invalid
- Status changed from new to closed
- Version 2.0 deleted
By default, activity comments are not fetched. To fetch activity comments, use the 'display_comments'
parameter set to true and then pass the activity comment ID.
$act_item = bp_activity_get_specific( array( 'display_comments' => true, 'activity_ids' => ACTIVITY_COMMENT_ID ) );
#3
@
10 years ago
Dangit r-a-y, beat me to it for a second time today.
Just to add: Ideally, we would not require you to pass the 'display_comments=true' param, but it would require rewriting much of the activity query infrastructure to make it work. (More specifically, we'd have to do a pre-query to see if you are requesting activity_comments, and to flip display_comments
to true in those cases.) But this is not in the works at the moment, so please go with r-a-y's suggestion. Thanks.
The following works as a temporary fix to get the parent thread ID of an activity comment
$act_item = $wpdb->get_results("SELECT * FROM wp_bp_activity WHERE id = ACTIVITY_COMMENT_ID")
$act_item[0]->item_id