Membership 2 Pro registration not working with gravity forms

I have installed the Membership 2 Pro on my multisite. I wanted to use my gravityforms registration since I have it linked to create specific user roles and specific Mailchimp accounts. I have currently only activated it on the main domain icanapply.com. When I activated the plugin it created the pages which caused a conflict with the original registration I had. I am willing to use Buddypress as an alternative if there is a way to allow users to sign up for their specific accounts, for example "student", "tutor", etc.

I have added the following code to the Themes functions.php according to another post ( I am not sure what the "10, 4" refers to in the code:
add_filter('ms_frontend_handle_registration', '__return_false');

add_action( 'gform_user_registered', 'pi_gravity_registration_autologin', 10, 4 );
/**
* Auto login after registration.
*/
function pi_gravity_registration_autologin( $user_id, $user_config, $entry, $password ) {
$user = get_userdata( $user_id );
$user_login = $user->user_login;
$user_password = $password;

wp_signon( array(
'user_login' => $user_login,
'user_password' => $user_password,
'remember' => false
) );
}

I can manually add memberships. If the user tries, once they are logged in using gravity forms registration, the following error comes up: "You do not have sufficient previlliege to edit this post" This was not something I created and it is spelled incorrectly.

I will grant access to access to WPMUDEV via my dashboard if you want to take a look.

  • Nastia
    • Support Rock Star

    Hello @David , I hope you are well today!

    I'm not a code expert, but from what I see this code, that you put in functions.php, is for users to auto login to the site after registration.

    The Membership 2 registration, it's working differently with Gravity forms.
    The process it's looks like this:
    A:
    1. User comes to register
    2. User uses the Gravity form to register
    B:
    3. Then user comes to login
    4. After logging in, he needs to visit the membership page
    5. Select a membership
    6. Pay for the membership
    So, it's divided into two steps.

    If the user tries, once they are logged in using gravity forms registration, the following error comes up: "You do not have sufficient previlliege to edit this post" This was not something I created and it is spelled incorrectly.

    You mean if the user tries to sign up for a membership, he is having the following error?

    You do not have sufficient previlliege to edit this post

    Please advise,

    Kind Regards,
    Nastia

  • David Westgate
    • Flash Drive

    Hi Nastia,
    I tried again after removing the changes to the the functions.php file. I activated Buddypress as the default registration in Membership 2 Pro. I tried making the changes in the demo account. I have attached a screenshot. I created a new page "register-account" with the same error. I had clicked on "Registration" which took me to the sample memberships. I clicked on sign-up and it took me to the new page which is where I got the error.

    I also disable WP-members which was my default method for blocking pages.

  • Sajid
    • DEV MAN’s Sidekick

    Hi @David Westgate,

    Hope you are doing good today :slight_smile:

    I followed your steps but did not get that error message any where in the process. I clicked on registration, clicked on signup page and taken to BuddyPress signup form page as seen in attached screenshot.

    If you still getting the same error, then please grant support staff access so I can take a closer look. I can see the access is open but its not for the http://demo.icanapply.com/ site.

    Hope that helps! If you still need assistance, please don't hesitate to ask.

    Take care and have a nice day :slight_smile:

    Kind Regards,
    Sajid J

  • David Westgate
    • Flash Drive

    Hi Sajid,

    I am not seeing anyway to designate which site to grant access to through support but I did extend it longer. It is listed in my list of sites.

    I did just try again with the same error page when I go to the demo.icanapply.com/registration. I did not get notification that a new account was created either. This seems to be the Buddypress registration form. When I submit I get the error I provided earlier. I just tried to do the same on http://demo.icanapply.com/registration/business-registration/ and the registration worked. This is also a Buddypress Registration page. I received confirmation as the admin.Once I was logged in I tried to join a membership I got the error "You do not have sufficient previlliege to edit the post." It is saying to "edit"not view the post when I try to sign up.I don't see any way to edit this message either. If I go to the account page it does show the created user but if I try to add a membership I get the same error.

    Were you able to add a membership when you created an account?

    Thanks,
    David

  • Nastia
    • Support Rock Star

    Hello David, I hope you are doing well today!

    I tried to sign up for membership on icanapply.com and have the same error as you so:

    You do not have sufficient privilege to edit this post.

    I suspect this has something to do with the User Role Editor plugin. Would you please deactivate it and try again?

    Please advise,

    Kind Regards,
    Nastia

  • David Westgate
    • Flash Drive

    Hi Nastia,
    I disable the user role plugin. I was able to manually add the new user account I just created to a membership as the admin. I tried to add an additional membership as the sample user but got the same message. It does show that the user has the membership I added as the admin though.

    I was also trying to find where this message "You do not have sufficient previlliege to edit the post." is in any plugin because it is not something that I created. I would like to at least correct the spelling if it comes up for anyone.

    Thanks,
    David

    Thanks,
    David

  • Nastia
    • Support Rock Star

    Hello there @David!

    Would you please run a quick check for a conflict with a plugins? Deactivate all the plugins (please do not forget the network enabled plugins) and test again. If the issue is gone, activate one plugin at the time to find out which one is causing this issue.
    Please follow the flowchart from our manual:
    https://premium.wpmudev.org/manuals/using-wpmu-dev/getting-support/

    Let us know how it went!

    Kind Regards,
    Nastia

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.