[buddypress-trac] [BuddyPress] #3980: bp_activity_at_name_filter_updates() causes activity to be saved twice

buddypress-trac noreply at wordpress.org
Tue Dec 18 00:18:33 UTC 2012


#3980: bp_activity_at_name_filter_updates() causes activity to be saved twice
-------------------------------------------+-----------------------------
 Reporter:  r-a-y                          |       Owner:
     Type:  defect (bug)                   |      Status:  closed
 Priority:  normal                         |   Milestone:  Future Release
Component:  Activity                       |     Version:  1.5
 Severity:  normal                         |  Resolution:  fixed
 Keywords:  dev-feedback has-patch commit  |
-------------------------------------------+-----------------------------
Changes (by r-a-y):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 (In [6649]) Only fire the activity save hooks once. Fixes #3980.

 Previously, bp_activity_at_name_filter_updates() would run the
 BP_Activity_Activity::save() method again.  So basically, all activity
 save
 hooks would run twice; this caused problems for plugins that hooked into
 any activity save hook as their code would run twice.

 This commit changes the logic of how @mention activity items are linked
 and
 sent so the activity save hooks are only run once.

 bp_activity_at_name_filter_updates() now runs before an activity item is
 saved and detects if @mentions are found.  If @mentions exists, we add a
 hook to send the emails after the activity item is saved -
 bp_activity_at_name_send_emails().

 Hat-tip boonebgorges for feedback.

 For a full list of changes, view:
 https://buddypress.trac.wordpress.org/ticket/3980#comment:11

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/3980#comment:15>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list