Bug #20921
open"The Group for Group Admins" auto-invite should use our custom invites system
0%
Description
On the Commons, we auto-invite users who become group admins and mods to The Group for Group Admins (TGFGA) group.
This uses the cac-group-admin-auto-add
plugin. However this plugin was built with the BuddyPress group invites system. There have been changes to the BuddyPress invites API, which would require an audit, and also in #8641, we introduced our own invites system. Would it make sense to switch from BP's invite system to our one for this particular auto-group invite?
If we switch to using our custom invites system for the group invite to TGFGA, we will need to do two things:
1. We will need to set a user to be the inviter to TGFGA. Who should that be? Whomever is the inviter will receive screen notifications about users who join TGFGA. These notifications could be bothersome. See #20861. Currently, the group admins for TGFGA are Matt, Marilyn and Sarah Morgano. We can also look to disable these notifications as well if needed.
2. We might need to write a script to switch older group invites to TGFGA to our invites system. We would have to check BP's wp_bp_invitations
DB table and cross-reference the user IDs with the wp_bp_groups_members
DB table to see if they are members, as well as our wp_1_cac_invites
DB table to see if they already have a pending invite.
Related issues
Updated by Raymond Hoh 3 months ago
- Related to Bug #20861: Unread notifications for invites I didn't send added
Updated by Raymond Hoh 2 months ago
So I've done an audit of the cac-group-admin-auto-add
plugin, basically any TGFGA invite that has been sent to a user since CAC v1.15.12 from October 2019 has not worked. If a user goes to their group invites page (/members/me/groups/invites/
) from their TGFGA invite email, the TGFGA invite would not show up.
The issue is BuddyPress introduced a new invitations DB table and our older code needed to be updated to reference this newer DB table. In the older system, group invites used the wp_bp_groups_members
DB table and we manually updated the invite_sent
column in this table for this particular invite to 1
for performance reasons: https://github.com/cuny-academic-commons/cac/blob/7c5c45db72bd4299ca59c8c744219e11d43b6e07/wp-content/plugins/cac-group-admin-auto-add/bp-group-adminmod.php#L30-L42. In the new system, invites use the wp_bp_invitations
DB table and the invite_sent
column in this table also needs to be updated to 1
. Since we didn't do this, the TGFGA invite does not show up on the /members/me/groups/invites/
page. I've addressed this part of the issue in a new branch with the following commit: https://github.com/cuny-academic-commons/cac/commit/52291b3171f404ce4396ae6c85ac35a120ab46aa. However this only takes effect for new invites to TGFGA group.
There are also two UI issues with the older invites system. First, the "Commons Profile > Groups > Invites" page did not use the card layout as used in other areas of the site. I've addressed this in https://github.com/cuny-academic-commons/cac/commit/4c76a89a29e20ca5a9b6b5b4eccf4bd097dfdcd4. Secondly, the "Commons Profile > Groups > Invites" page is not displayed in the nav so the only way to get to this page is either via the "Notifications" page or via the link in the invite email. This latter issue probably doesn't need to be addressed if we switch to our custom invites system. There shouldn't be any reason why we need to use the BuddyPress group invites system, right?
Next steps are to switch out TGFGA group invite to use our newer cac-onboarding
invites system and to decide what to do for the broken invites to TGFGA. My suggestion is we can write a script to invite any current group admin or mod that isn't a group member of TGFGA. We might want to define "current" as any newly-created group in 2024 since active group admins / mods are the ones that will benefit from using the TGFGA group, but would like others thoughts on this.
Updated by Boone Gorges 2 months ago
My suggestion is we can write a script to invite any current group admin or mod that isn't a group member of TGFGA. We might want to define "current" as any newly-created group in 2024 since active group admins / mods are the ones that will benefit from using the TGFGA group, but would like others thoughts on this.
2024-01-01 for date_created on the group seems like a good cutoff, if others agree.