[buddypress-trac] [BuddyPress Trac] #6494: Duplicate activity comments when post/activity comments sync is on

buddypress-trac noreply at wordpress.org
Thu Jun 11 12:07:27 UTC 2015


#6494: Duplicate activity comments when post/activity comments sync is on
-------------------------------+-----------------------
 Reporter:  imath              |      Owner:
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  2.4
Component:  Component - Blogs  |    Version:  2.0
 Severity:  normal             |   Keywords:  has-patch
-------------------------------+-----------------------
 While working on #6482, and thanks to shanebp's tests it appears that when
 javascript is disabled (you can simulate this by doing `define(
 SCRIPT_DEBUG, false )` ), when you post an activity comment to a blog post
 activity, two activity comments will be created.

 It doesn't happen when javascript is enabled, because instead of being
 created twice, the activity comment is updated. Reason is Ajax is using an
 action post variable so we arrive here
 https://buddypress.trac.wordpress.org/browser/trunk/src/bp-blogs/bp-blogs-
 functions.php#L646

 This means when an activity comment is posted :
 - a post comment is created
 - the activity is immediatly resaved to build the WP comment permalink
 - then the post comment is updated
 - then the activity is updated.

 We are saving the activity three times and the post comment twice. I
 suggest the attached patch to only save these items respectively twice and
 once (i.e. : what we really need)

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


More information about the buddypress-trac mailing list