Skip to content

8675 - user group invites#15

Closed
adiloztaser wants to merge 23 commits intobuddypress:masterfrom
adiloztaser:8675_user_group_invites
Closed

8675 - user group invites#15
adiloztaser wants to merge 23 commits intobuddypress:masterfrom
adiloztaser:8675_user_group_invites

Conversation

@adiloztaser
Copy link
Copy Markdown

Trac ticket: https://buddypress.trac.wordpress.org/ticket/8675


This Pull Request is for code review only. Please keep all other discussion in the BuddyPress Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the WordPress Core Handbook for more details.

Copy link
Copy Markdown
Contributor

@imath imath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for this PR. I agree it's visually fixing the issue. But if an Admin clicks on the button to accept the invite for the user then:

  • we have an Ajax error in Nouveau and the invite is not accepted.
  • we have a regular error in Legacy but the invite is accepted.

So changing this behavior needs more changes probably:

But it might not just be a matter of switching from logged in user ID to displayed user ID, it's probably a broader issue.

Subnavs only register if user can see the page so it looks we don't need these
extra controls.
@adiloztaser
Copy link
Copy Markdown
Author

Hey @imath, thanks for the review. Actually I've never tried to use Accept/Reject buttons, I'll look asap.

@adiloztaser
Copy link
Copy Markdown
Author

Hi again @imath,

I believe accept/reject buttons should work for admins after my last commits. Can you look again?

I also agree about your concern to inform users but I'm not sure where to generate it.

@adiloztaser adiloztaser requested a review from imath April 11, 2022 20:32
Copy link
Copy Markdown
Contributor

@imath imath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @adiloztaser

Thanks a lot for your changes 👍. I've just tested, it works as expected. About emailing the user, i'd use the 'groups_reject_invite' & 'groups_accept_invite' hook to check if ( $user_id !== bp_loggedin_user_id() && bp_current_user_can( 'bp_moderate' ) to decide whether to send a notification email.

@adiloztaser
Copy link
Copy Markdown
Author

adiloztaser commented Apr 13, 2022

Hi again @imath,

I've added an email notification based on your suggestion.
I have two questions:
1-) Should we create a new email or just use existing ones?
2-) Should we add unsubscribe link to email or we always inform users after that action?

I'm also open to any suggestion about current version.

@imath
Copy link
Copy Markdown
Contributor

imath commented Apr 14, 2022

Thanks a lot @adiloztaser for these improvements.

I think we should have two specific emails eg: "An administrator accepted an invitation to join {{group.name}} on your behalf. If you disagree with this, you can leave the group at anytime using this link: {{{leave-group.url}}}

In this case we don't need the unsubscribe link.

The new code you added looks great.

@adiloztaser
Copy link
Copy Markdown
Author

Thank you for feedback @imath, I'll keep working on it.

@adiloztaser
Copy link
Copy Markdown
Author

adiloztaser commented Apr 15, 2022

Hi there.

I've added new emails, as you guess to do that I needed to increase the db_version. I don't know is there any rule for this, if I did anything wrong please let me know.

I couldn't add leave url to accepted invate email because we have nonce check and I didn't create a valid url. I've added member groups page, I think it's good enough for navigating user.

Copy link
Copy Markdown
Contributor

@imath imath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's looking great thanks a lot for you work on it @adiloztaser

I just think we should do the small changes I suggested in my review 😉

adiloztaser and others added 6 commits April 17, 2022 14:25
Co-authored-by: imath <imathi.eu@outlook.fr>
Co-authored-by: imath <imathi.eu@outlook.fr>
Co-authored-by: imath <imathi.eu@outlook.fr>
Co-authored-by: imath <imathi.eu@outlook.fr>
Co-authored-by: imath <imathi.eu@outlook.fr>
Co-authored-by: imath <imathi.eu@outlook.fr>
adiloztaser and others added 6 commits April 17, 2022 14:30
Co-authored-by: imath <imathi.eu@outlook.fr>
Co-authored-by: imath <imathi.eu@outlook.fr>
Co-authored-by: imath <imathi.eu@outlook.fr>
Co-authored-by: imath <imathi.eu@outlook.fr>
Co-authored-by: imath <imathi.eu@outlook.fr>
Co-authored-by: imath <imathi.eu@outlook.fr>
@adiloztaser
Copy link
Copy Markdown
Author

Thank you for review and suggestions @imath. I hope its ready to go.

@adiloztaser adiloztaser requested a review from imath April 17, 2022 11:36
Copy link
Copy Markdown
Contributor

@imath imath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks a lot @adiloztaser I'll commit it to our SVN Trunk asap.

thebrandonallen pushed a commit to thebrandonallen/buddypress that referenced this pull request Apr 22, 2022
As a site admin can view the displayed user groups invites, listed invites have to be the one of this user and not the ones of the site admin.

Adapt the Group Invites feature so that site admins can accept or reject on behalf of the displayed user the listed invites. These two actions made by an admin will generate a specific BP Email informing the user of it.

Props oztaser, dcavins, espellcaste

Closes buddypress/buddypress#15
Fixes #8675



git-svn-id: https://buddypress.svn.wordpress.org/trunk@13273 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
@adiloztaser adiloztaser deleted the 8675_user_group_invites branch April 22, 2022 06:20
dcavins pushed a commit to dcavins/buddypress-wp-svn that referenced this pull request May 23, 2022
As a site admin can view the displayed user groups invites, listed invites have to be the one of this user and not the ones of the site admin.

Adapt the Group Invites feature so that site admins can accept or reject on behalf of the displayed user the listed invites. These two actions made by an admin will generate a specific BP Email informing the user of it.

Props oztaser, dcavins, espellcaste

Closes buddypress/buddypress#15
Fixes #8675



git-svn-id: http://buddypress.svn.wordpress.org/trunk@13273 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
emaralive pushed a commit to emaralive/omt-buddypress-sync that referenced this pull request Nov 2, 2025
As a site admin can view the displayed user groups invites, listed invites have to be the one of this user and not the ones of the site admin.

Adapt the Group Invites feature so that site admins can accept or reject on behalf of the displayed user the listed invites. These two actions made by an admin will generate a specific BP Email informing the user of it.

Props oztaser, dcavins, espellcaste

Closes buddypress/buddypress#15
Fixes #8675



git-svn-id: https://buddypress.svn.wordpress.org/trunk@13273 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
emaralive pushed a commit to emaralive/buddypress-sync that referenced this pull request Nov 3, 2025
As a site admin can view the displayed user groups invites, listed invites have to be the one of this user and not the ones of the site admin.

Adapt the Group Invites feature so that site admins can accept or reject on behalf of the displayed user the listed invites. These two actions made by an admin will generate a specific BP Email informing the user of it.

Props oztaser, dcavins, espellcaste

Closes buddypress/buddypress#15
Fixes #8675



git-svn-id: https://buddypress.svn.wordpress.org/trunk@13273 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants