Project

General

Profile

Bug #15677

Duplicate email template posts are being created during a BuddyPress upgrade

Added by Raymond Hoh 4 months ago. Updated about 1 month ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
BuddyPress (misc)
Target version:
Start date:
2022-03-19
Due date:
% Done:

0%

Estimated time:

Description

See https://redmine.gc.cuny.edu/issues/15675#note-3.

Duplicate email templates are being created whenever a BuddyPress DB update is required (I'm guessing).

The Group Email Subscription plugin has some logic to determine whether a new email template should be created or not: https://github.com/boonebgorges/buddypress-group-email-subscription/blob/d322c0bfb053b9ee23d1e25a250717d1e506313a/admin.php#L398. But judging by the other duplicate BuddyPress email templates that were also created, it's probably caused by something else.


Related issues

Related to CUNY Academic Commons - Feature #15675: Group Email Subject line editResolved2022-03-18

Related to CUNY Academic Commons - Feature #15883: Release BPGES updateNew2022-04-08

History

#1 Updated by Raymond Hoh 4 months ago

#2 Updated by Raymond Hoh 3 months ago

Boone, I took a closer look at GES and it looks like the post type exists check defaults to false when installing the email templates: https://github.com/boonebgorges/buddypress-group-email-subscription/blob/d322c0bfb053b9ee23d1e25a250717d1e506313a/admin.php#L386. Since ass_install_emails() is hooked to 'bp_core_install_emails', it runs whenever BuddyPress (or another plugin) calls bp_core_install_emails(). BuddyPress has used this function in their updater over the past couple of major releases, which has resulted in the duplicate GES email templates.

I've added a PR for your review here: https://github.com/boonebgorges/buddypress-group-email-subscription/pull/221

#3 Updated by Colin McDonald 3 months ago

Just adding Boone and Matt as watchers here to make sure we get the right eyes reviewing this for you Ray before we move ahead. Thanks!

#4 Updated by Boone Gorges 3 months ago

I've merged the PR in the BPGES repo. Ray, should I do a BPGES release, or can we apply this directly to the Commons?

#5 Updated by Raymond Hoh 3 months ago

It would be good to do a general BPGES release before the next major BuddyPress release, but for our purposes, we can patch our current version of BPGES now. I'll patch up BPGES later today.

#6 Updated by Boone Gorges 3 months ago

Sounds good - I'm going to open a separate ticket so I don't forget to release BPGES in the upcoming weeks.

#7 Updated by Boone Gorges 3 months ago

#8 Updated by Boone Gorges about 1 month ago

  • Status changed from New to Staged for Production Release

In https://github.com/cuny-academic-commons/cac/commit/73c34c545bfd64ea7c0f781d321d3344f42b2b8d I've updated the Commons to the latest 4.0.x branch of the BPGES repo, which includes this fix.

#9 Updated by Boone Gorges about 1 month ago

  • Status changed from Staged for Production Release to Resolved

Also available in: Atom PDF