Bug #11889
closedBlog Posts Bulk Editing led to group notification
Added by Stefano Morello about 5 years ago. Updated about 5 years ago.
0%
Description
Hi! I was bulk editing and standardizing categories on the GC Digital Fellows blog ( http://digitalfellows.commons.gc.cuny.edu ), and I think some change I made to an already published 2014 post triggered a message to the GC Digital Fellows Commons group (see attached). I believe this accident is related to this other ticket https://redmine.gc.cuny.edu/issues/8535
Files
Screen Shot 2019-09-22 at 12.17.37 PM.png (125 KB) Screen Shot 2019-09-22 at 12.17.37 PM.png | Stefano Morello, 2019-09-22 12:21 PM | ||
5BDF46D6-0D83-4E67-AE10-25A730C340F1.jpeg (437 KB) 5BDF46D6-0D83-4E67-AE10-25A730C340F1.jpeg | Stefano Morello, 2019-09-23 02:56 AM |
Updated by Stefano Morello about 5 years ago
Just a follow up — the same thing happened again, with multiple posts, as I was bulk editing and editing individual posts tonight (hard to tell whether these have been triggered by an individual or a bulk edit)
Updated by Boone Gorges about 5 years ago
- Assignee set to Raymond Hoh
Ray, could you please have a look?
Updated by Raymond Hoh about 5 years ago
- Category name set to Email Notifications
- Status changed from New to Staged for Production Release
Right now in the BP Groupblog plugin, we allow edits to create or to modify an activity item, which would then trigger an email notification. So when someone like Stefano is bulk-editing posts, emails would be sent out to the group.
Boone, to suppress email notifications from occurring during bulk edits or quick edits, I've decided to hack into when a bulk or quick edit is occurring, and then I'm piggybacking off the 'send_to_group_blog'
meta (introduced in #10847) to tell GES not to send the email:
https://github.com/cuny-academic-commons/cac/compare/8780f31...229217c
The good thing is the activity item is still recorded into the group activity stream if it was missing in the first place.
Let me know what you think of the approach.
Updated by Boone Gorges about 5 years ago
Thanks, Ray. For CAC, this looks like a good solution.
More generally, I'm not sure what to think. Is it a feature or a bug to send email notifications on edit, whether single or bulk edits? Seems like we might consider disabling them altogether. Given that edits also have the 'new_groupblog_post' type, do we have enough information to suppress the notifications at the BPGES level? Would that even be desirable? I'm curious whether you have intuitions (or experience from other sites) on whether these activity items and/or notifications are needed.
Updated by Raymond Hoh about 5 years ago
More generally, I'm not sure what to think. Is it a feature or a bug to send email notifications on edit, whether single or bulk edits?
It can be jarring when older blog posts are suddenly sent to the group, so I think we shouldn't send email notifications on any blog post edit.
A blog post generally doesn't have any pertinent information like an event change of venue or time so I think we're safe to disable.
The main branch of BP Groupblog doesn't allow email notifications to be disabled while allowing the blog post item to be recorded into group activity stream. But, our specialized "Send to Group" metabox feature for the Commons does allow edits to be recorded into the group activity stream, while disabling email notifications.
Maybe we can merge our "Send to Group" code into the BP Groupblog plugin?
Updated by Boone Gorges about 5 years ago
A user-facing toggle like 'Send to Group' seems like a decent feature, though the way it's currently written for the Commons is a bit hacky IIRC.
I'm wondering whether it's possible for us to modify bp-groupblog or even BP for BPGES to detect that a 'new_groupblog_post' activity item is, in fact, an edit, so that it can suppress its email notification (without relying on a user toggle). Some ideas for this:
- Add a new property to `BP_Activity_Activity` items along the lines of `is_new`. It'd be set to `true` when not populated from the DB. BPGES would bail if it sees is_new=false. When bp-groupblog fetches an existing item in bp_groupblog_catch_transition_post_status(), is_new would be false.
- Instead of a new object property, BP should pass an `is_new` value to the `bp_activity_before_save` and `bp_activity_after_save` actions. (This actually seems useful for lots of reasons, and might be more in line with WP hooks like `save_post`.)
- Build BPGES awareness into bp-groupblog. In bp_groupblog_set_group_to_post_activity(), if we know that we're editing an existing activity item, then we remove_action( ... BPGES function ... ) just before $activity->save()
The last is probably the easiest, though it's in some ways the least elegant. What do you think of these ideas?
Updated by Boone Gorges about 5 years ago
- Status changed from Staged for Production Release to Resolved