Project

General

Profile

Actions

Bug #8535

closed

Blog post edit triggers group notification

Added by Boone Gorges over 7 years ago. Updated about 7 years ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
Group Blogs
Target version:
Start date:
2017-08-15
Due date:
% Done:

0%

Estimated time:
Deployment actions:


Related issues

Related to CUNY Academic Commons - Bug #8183: Edit of Post creates notification emailsResolvedBoone Gorges2017-05-22

Actions
Related to CUNY Academic Commons - Bug #2844: Commons bug re: editing blog postsResolvedBoone Gorges2013-10-22

Actions
Related to CUNY Academic Commons - Bug #6350: Editing blog posts results in activity itemsResolvedBoone Gorges2013-10-22

Actions
Related to CUNY Academic Commons - Bug #14017: Editing of blog post leads to group notificationResolvedRaymond Hoh2021-02-21

Actions
Actions #1

Updated by Boone Gorges over 7 years ago

  • Related to Bug #8183: Edit of Post creates notification emails added
Actions #2

Updated by Boone Gorges over 7 years ago

  • Related to Bug #2844: Commons bug re: editing blog posts added
Actions #3

Updated by Boone Gorges over 7 years ago

  • Related to Bug #6350: Editing blog posts results in activity items added
Actions #4

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..."?

Actions #5

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.

Actions #6

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.

Actions #7

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?

Actions #8

Updated by Boone Gorges about 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.

Actions #9

Updated by Raymond Hoh about 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.

Actions #10

Updated by Boone Gorges about 7 years ago

Good call, Ray! I'll implement that.

Actions #11

Updated by Matt Gold over 3 years ago

  • Related to Bug #14017: Editing of blog post leads to group notification added
Actions

Also available in: Atom PDF