Bug #15024
closed
Erroneous social paper notifications
Added by Matt Gold almost 3 years ago.
Updated almost 3 years ago.
Category name:
Social Paper
Description
Hi Boone -- I just received a bunch of notifications that social papers I'm not following have been updated. First, I doubt whether they have truly been updated, and Second, I know I'm not following them. Here is a sample notification:
The paper "Rhetorical Analysis of Mother Tongue" has been updated [CUNY Academic Commons]
Inbox
CUNY Academic Commons
11:52 AM (1 minute ago)
to me
The paper "Rhetorical Analysis of Mother Tongue" has been updated
Editor: Sajan Chokar (He/Him/His)
Visit the paper: https://commons.gc.cuny.edu/papers/rhetorical-analysis-of-mother-tongue/
You receieved this notification because you are following the paper "Rhetorical Analysis of Mother Tongue". To unfollow, visit https://commons.gc.cuny.edu/papers/rhetorical-analysis-of-mother-tongue/ and click the Unfollow button.
- Has duplicate Support #15025: emails for all the papers on the commons that have been changed added
- Related to Bug #15026: Email Notifications from Social Paper added
I am getting them too.
For the time being, I've disabled mail from Social Paper.
I'll investigate to see why this might be happening.
- Category name set to Social Paper
- Assignee changed from Boone Gorges to Raymond Hoh
I've spent a few minutes looking into this.
- The papers in question are indeed being edited.
- This is triggering https://github.com/cuny-academic-commons/social-paper/blob/master/includes/hooks-buddypress-notifications.php#L405
- social-paper is fetching the "leader_id" of the paper in order to determine followers https://github.com/cuny-academic-commons/social-paper/blob/master/includes/hooks-buddypress-notifications.php#L416
- This checks the 'cacsp_activity_id' postmeta, but it's empty in the case of these paper objects, and the function doesn't appear to be able to create the activity item https://github.com/cuny-academic-commons/social-paper/blob/c6461a16713fe2956549552ea52ee45d814efe67/includes/hooks-buddypress-follow.php#L1047 As such, a NULL value is stored in the wp_1_postmeta table, and the 'leader_id' is null as well.
- The behavior of bp_follow_get_followers() is difficult to predict when leader_id is empty. In this case, it's pulling up ~975 users, which explains why so many got the email.
For the moment, I've commented out the call to wp_mail() in social-paper: https://github.com/cuny-academic-commons/social-paper/blob/master/includes/hooks-buddypress-notifications.php#L146
Ray, could you please investigate? At the very least, buddypress-followers should have a failsafe, such that when no leader_id is passed, no followers are returned. It may also be helpful to see why social-paper isn't properly generating the 'cacsp_activity_id' postmeta value, though given the status of social-paper, it's not worth sticking a lot of time into it.
Thanks for the rundown, Boone.
I'm looking into this.
- Status changed from Assigned to Resolved
- Target version set to 1.18.24
- Related to Bug #15029: Social papers with post passwords should not record 'new_cacsp_edit' activity items added
Thanks for the quick work on this, Ray!
Also available in: Atom
PDF