Bug #8535
closedBlog post edit triggers group notification
0%
Description
Related: #8183
This bug has re-emerged, on this post https://jitp.commons.gc.cuny.edu/the-places-of-mentorship-and-collaboration/, triggering a notification in this group: https://commons.gc.cuny.edu/groups/journal-of-interactive-technology-and-pedagogy-public-group/
Related issues
Updated by Boone Gorges over 7 years ago
- Related to Bug #8183: Edit of Post creates notification emails added
Updated by Boone Gorges over 7 years ago
- Related to Bug #2844: Commons bug re: editing blog posts added
Updated by Boone Gorges over 7 years ago
- Related to Bug #6350: Editing blog posts results in activity items added
Updated by Boone Gorges over 7 years ago
Here's the relevant data from the activity table:
id: 467129
date_recorded: 2017-08-15 17:56:57
type: new_groupblog_post
Sequentially, the id 467129 means that the activity item was created just this afternoon (at the date_recorded timestamp). It was not a modification of an existing activity item.
Ray, do you have a hypothesis about what might be happening here? Is it possible that the activity item corresponding to the original blog post was deleted, so that when the edit took place, bp-groupblog created a new activity item? If this is true, then why does the `action` read "...edited the blog post..." instead of "...wrote a new blog post..."?
Updated by Raymond Hoh over 7 years ago
I think that the following line might not be necessary anymore in bp-groupblog
:add_action( 'bp_activity_before_save', 'bp_groupblog_set_group_to_post_activity');
See:
https://github.com/boonebgorges/bp-groupblog/blob/1.8.x/bp-groupblog.php#L1211
This is because we are already hooking into the 'transition_post_status'
hook to handle edits:
https://github.com/boonebgorges/bp-groupblog/blob/1.8.x/bp-groupblog.php#L1093
So what is happening at the moment is our edit activity catcher is running twice. Removing one of them should fix the issue. Does that sound about right, Boone?
And yes, I do believe the original activity item was somehow deleted.
Updated by Raymond Hoh over 7 years ago
- Assignee set to Raymond Hoh
- Target version set to 1.11.10
Did some local testing and discovered that we no longer need to hook onto the 'transition_post_status'
hook as this was causing the additional email during edits. Not sure exactly which version of BuddyPress made these changes unnecessary, but I don't feel like going through the BuddyPress changelog to find out :)
Fixed in https://github.com/cuny-academic-commons/cac/commit/8b26dac1342cc668254ec54e4824366a09e5a7f8.
Updated by Boone Gorges over 7 years ago
Excellent - thanks, Ray. Perhaps it's linked to https://buddypress.trac.wordpress.org/ticket/6834?
If so, then making the same change to the mainline bp-groupblog plugin will effectively bump the minimum requirement to BP 2.5. Does that sound correct to you?
Updated by Boone Gorges over 7 years ago
- Status changed from New to Resolved
Ray, if you get a minute, could you think about my question above?
I think we can mark this ticket resolved for the purposes of the Commons.
Updated by Raymond Hoh over 7 years ago
Boone, it looks like you're correct about BP ticket 6834.
This will indeed bump the requirement for bp-groupblog to BP v2.5 unless we check if the current version of BuddyPress is 2.5.
We could do the following inside bp_groupblog_catch_transition_post_type_status()
:
// If BP 2.5, bail. if ( function_exists( 'bp_register_post_types' ) ) { return; }
That way we keep compatibility with older versions.
Updated by Matt Gold over 3 years ago
- Related to Bug #14017: Editing of blog post leads to group notification added