#8550 closed defect (bug) (fixed)
"Invitations" tab visible to users when they're not able to send invitations.
Reported by: | niftythree | Owned by: | dcavins |
---|---|---|---|
Milestone: | 10.0.0 | Priority: | normal |
Severity: | normal | Version: | 1.0 |
Component: | Groups | Keywords: | has-patch |
Cc: |
Description
Hello,
We’ve noticed a bit of a quirk in BuddyPress. When the “Friend Connections” component is turned off, but the “User Groups” component is still turned on, users will still see the “Invitations” tab under groups in their own profiles, even though no user can send them an invitation to a group.
We’ve done some testing and can’t work out an obvious reason why this tab would still be visible/available to users when it’s not possible to send invitations to other users.
We're running BuddyPress version 9, and occurs when all other plugins are deactivated and a default theme is used.
Thanks.
Attachments (2)
Change History (17)
#2
@
3 years ago
Hi @imath,
Thanks for getting back to us so quickly! :)
We're using the BP Legacy template pack; regardless, we thought we'd try the code anyway, but the "Invitations" tab was still visible.
Thanks.
#4
@
3 years ago
- Keywords 2nd-opinion added
- Milestone changed from Awaiting Review to 10.0.0
- Version changed from 9.0.0 to 1.0
Thanks for your feedback @niftythree I now fully understand the issue. I agree we should improve this part of the Groups invite feature.
Historically Groups invite required the Friends component to be active. BP Nouveau added an exception to this allowing members to invite any others.
If we use BP Legacy having the friends component inactive:
- The single Group invite nav is not showing ✅
- The Group settings create screen as well as the Group manage screen are showing a setting to let the Group creator choose which Group roles can invite people ❌
- The single Member's Pending invites nav is showing (what you reported) ❌
If we use BP Nouveau it's not possible to disable the Groups Invite feature even if we do add_filter( 'bp_nouveau_groups_disallow_all_members_invites', '__return_true' );
❌
Using this filter is only making an effect when the friends component is active.
We should fix red crosses 🤔. @dcavins I'd like to have your opinion about it. What do you think?
#5
@
3 years ago
Hi @imath
Thanks for the update and all of the information; that really helps us to understand the context. 😊
This ticket was mentioned in Slack in #buddypress by imath. View the logs.
3 years ago
#8
@
3 years ago
I'm attaching a patch that adds a new function bp_get_groups_invitations_allowed()
. This centralizes the check if group invitations are enabled generally or not, rather than tying it directly to whether the friends component is enabled. This offers the advantage that a dev could choose to disable invitations even if they want to have friendships enabled. (Or disable them entirely if using Nouveau.)
@imath please make sure I've got the check right for Nouveau. Thanks!
#10
@
3 years ago
- Keywords has-patch added; 2nd-opinion removed
@dcavins great idea about using a component feature for Group invitations 👍.
I think we don't need to introduce bp_get_groups_invitations_allowed()
and we shouldn't use bp_nouveau_..
functions into Core files.
The invitations feature should only be added if the friends component is active. The Nouveau template pack can filter bp_is_groups_invitations_active
to activate the Invitations feature if inviting any member is allowed (meaning bp_nouveau_groups_disallow_all_members_invites
is not filtered to true).
I've tested in legacy & nouveau and it works pretty well. I even tested using add_filter( 'bp_is_groups_invitations_active'
, '__return_true' )
with Legacy and found a fatal into the send-invites template before fixing it.
If you're ok with my suggestions, feel free to commit and fix the ticket ;)
This ticket was mentioned in Slack in #buddypress by imath. View the logs.
3 years ago
This ticket was mentioned in Slack in #buddypress by dcavins. View the logs.
3 years ago
#14
follow-up:
↓ 15
@
3 years ago
Quick one team, will this fix be included in the next Buddypress release? - as I saw this bug a while ago, I thought it was just me, until I googled this and found your thread.
Cheers
Rami
#15
in reply to:
↑ 14
@
3 years ago
Replying to ramirocastro:
Quick one team, will this fix be included in the next Buddypress release? - as I saw this bug a while ago, I thought it was just me, until I googled this and found your thread.
Cheers
Rami
Yep, it's in v10, which is available from a plugin repo near you as of today.
Hi,
if you're using the BP Nouveau template pack, it's a feature 😉. This template pack comes with a Group Invites UI allowing users to invite any other to join their group. If you want to disable it you can use:
add_filter( 'bp_nouveau_groups_disallow_all_members_invites', '__return_true' );
Are you using the BP Nouveau template pack (see Settings > BuddyPress > Options)?