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

BUG: xProfile field visibility not set to defaults after PMPro signup #74

Open
dparker1005 opened this issue Dec 22, 2020 · 2 comments
Open

Comments

@dparker1005
Copy link
Member

Steps to replicate:

  1. Create a site with a RH field linked to a BP xProfile field
  2. Set the xProfile field to have a default visibility of "Only Me" and allow members to override it
  3. Sign up as a new user via PMPro Checkout or PMPro Add Member
  4. As a non-user, visit that new user's profile and see that the xProfile field is visible despite "Only Me" being the default option

When a user is registered on the site via Users > Add New, the field is correctly hidden. BuddyPress must be hooking into that process to generate the usermeta field that holds field visibility info (bp_xprofile_visibility_levels). We should also generate that piece of usermeta whenever a user is added via PMPro.

Additional information:

  • xprofile_get_field_visibility_level() determines which fields are shown on profile. Doesn’t care about default values unless users are not able to edit visibility values.
  • xprofile_set_field_visibility_level() sets the visibility for a particular field. We should probably use this whenever a user registers with PMPro
  • bp_core_activate_signup() is one place where BuddyPress loops through xprofile_set_field_visibility_level() for new users. Either we should use this function or base our solution off of it.

Workarounds:
Until this has a fix in the add on, a temporary solution would be to hook into the core WP's user_register hook and call xprofile_set_field_visibility_level() for each of the RH fields that you created.

@andrewlimaza
Copy link
Collaborator

Marking this as Needs to recreate as it's been a while, once issue is recreated we can look at resolving it. Scheduling to look at this in V1.3

@JarrydLong
Copy link
Contributor

We need to expand on this following 2.9's update as the default code that copies/sets data for xProfile fields from RH don't work now when using User Fields as the $pmprorh_registration_fields global appears to be empty.

We're going to need to possibly rework how we save RH data to xProfile fields with User Fields and then include the visibility params because the current code doesn't set the RH data to xProfile fields when updating a profile

@andrewlimaza andrewlimaza removed this from the V1.3 milestone Jul 22, 2022
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