[buddypress-trac] [BuddyPress Trac] #8343: Custom Post Type activity in groups create duplicates

buddypress-trac noreply at wordpress.org
Thu Aug 6 03:39:23 UTC 2020


#8343: Custom Post Type activity in groups create duplicates
--------------------------+-----------------------------
 Reporter:  etatus        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Core          |    Version:  6.1.0
 Severity:  major         |   Keywords:
--------------------------+-----------------------------
 If I add support for "buddypress-activity" to my CPT (with
 **`add_post_type_support()`** and
 **`bp_activity_set_post_type_tracking_args()`** functions) everything
 works fine.

 If I especify `'component_id => 'groups'` in
 **`bp_activity_set_post_type_tracking_args()`**, the tracking still works,
 but `item_id` is by default the blog ID instead the group ID, so the
 activity is created but it will not be shown in group activity page.

 If I fix this, using **`bp_after_activity_add_parse_args`** filter to set
 `item_id` to the group ID (`$args['item_id'] =
 bp_get_current_group_id();`) the activity is created and it is shown in
 group activity page.

 BUT...

 The problem is everytime I update the post, a new activity is generated,
 so there will be several activities with exactly the same information for
 one single goup post.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8343>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list