#6375 closed defect (bug) (fixed)
Need to fix parameter in do_action statement for sending email notifications to commenters you have received comments
Reported by: | dtc7240 | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 2.3 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Activity | Keywords: | has-patch |
Cc: |
Description
Hi guys. In #6057, there was some discussion concerning adding reply notifications to the new wp_bp_notifications table. I have some thoughts on that, but I'll weigh in on that discussion there after I finish this ticket.
As I'm actually running my BuddyPress site in an app environment via PhoneGap, my site features actual push notifications. The trigger I'm using to generate a push notification is the bp_notification_before_save hook. In order to generate a push notification when someone has replied to something you generated in the activity stream, I am for now using both the bp_activity_sent_reply_to_update_email and bp_activity_sent_reply_to_reply_email hooks to populate the notifications table myself.
While I was going through the code, I ran across a problem with the parameters of the bp_activity_sent_reply_to_reply_email hook that appears to just be a copy/paste oversight. I would guess that the entire if statement in which this hook is contained was originally copied from the if statement containing the bp_activity_sent_reply_to_update_email hook and then modified.
The user_id passed as a parameter in the bp_activity_sent_reply_to_reply_email do_action hook is that of the author of the activity that started the thread (as it should be in the other hook), but in this case should be the user_id of the author of the comment to which a reply is being made.
Can we please change "$original_activity->user_id" to "$parent_comment->user_id" in the "bp_activity_sent_reply_to_reply_email" hook?
Or if you're worried someone is currently using that hook with the incorrect data, create a new hook with the alteration?
Many thanks,
Scott
Yeah, I think you're right that this was a copy-paste error - the hook is kinda useless as is. (It's possible to get the parent_comment from the
$params
passed, but it is a pain.) I don't see any active use of the hook in the plugins repo or on Github, and anyone using it is probably experiencing brokenness anyway, so let's just change it.