Duplicate email template posts are being created during a BuddyPress upgrade
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.
#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
#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.