#5592 closed defect (bug) (no action required)
Can not retrieve a specific activity comment.
| Reported by: | godavid33 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Activity | Version: | |
| Severity: | normal | 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
@
12 years ago
- Component Core → Activity
- Milestone Awaiting Review
- Priority high → normal
- Resolution → invalid
- Status new → closed
- Version 2.0
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
@
12 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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