Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Member Edit - User role replaced if current role filtered out by editable_roles filter #2960

Open
3 tasks done
ipokkel opened this issue Apr 16, 2024 · 1 comment
Open
3 tasks done
Assignees

Comments

@ipokkel
Copy link
Member

ipokkel commented Apr 16, 2024

Describe the bug
A user's role is replaced with the next available role when updating a member's details on the Member Edit page if the user's current role is filtered out by the editable_roles filter hook.

Here's an example case: strangerstudios/pmpro-membership-manager-role#16

To Reproduce
Steps to reproduce the behavior:

  1. Implement a customization recipe that filters out some roles (https://gist.github.com/ipokkel/9e62334689a407c8d091a78a217e6e42)
  2. Navigate to Memberships > Members, find a member that has one of the filtered-out roles assigned, and click on "Edit Member" for that user.
  3. On the Edit Member page observe that the user's role is not displayed in the Role dropdown and the next available role is displayed.
  4. Click the "Update User Info" button and after the "User updated" confirmation message is displayed navigate to Users > All Users and observe that the user's role previous role was changed.

Screenshots
2024-04-16_10-11-39

2024-04-16_10-13-47

2024-04-16_10-16-52

Expected behavior
The "Role" select input to include the member's current role even if the role was filtered out using the editable_roles filter hook.

Isolating the problem (mark completed items with an [x]):

  • I have deactivated other plugins and confirmed this bug occurs when only Paid Memberships Pro plugin is active.
  • This bug happens with a default WordPress theme active, or Memberlite.
  • I can reproduce this bug consistently using the steps above.

WordPress Environment

- WordPress 6.5.2
- Paid Memberships Pro 3.0.2
@andrewlimaza
Copy link
Contributor

Related issue: #2959

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants