Membership - Admin users being set to different member roles

Hi,

I'm having an intermittent but repeated problem where admin users on the site are being set to have a different membership (i.e. their member level is "Admin User" and they are being set to "Professional".) This happens sometimes after creating a new user in the back end or sometimes after changes settings in the Membership plugin.

This is really a problem for us as we are hooking into the 'ms_model_relationship_create_ms_relationship_before' action and changing the WP and Buddypress user roles when Membership makes a change. This means our admin users are losing access to the WP back end.

Could you please investigate why this might be happening?

Thanks,

Melanie

  • Predrag Dubajic
    • Support

    Hey @Melanie,

    Hope you're well :slight_smile:

    Can you please give some more info about this part:

    This happens sometimes after creating a new user in the back end or sometimes after changes settings in the Membership plugin.

    Is there a pattern when this happens while creating new user in backend and what changes do you make to settings?

    Any info would be appreciated so we can try pinpointing the cause of this.

    Best regards,
    Predrag

  • Melanie
    • WPMU DEV Initiate

    Hi,

    No it's very strange, there's not a clear pattern. Earlier it would reliably happen if I (as an admin) created a new WP user in the WP backend. But I just tried that now and it didn't trigger it.

    Earlier today I changed some settings on one of the membership levels I have set up (I added Paypal payments). Then after adding that payment gateway I tried to go to the theme editor but got the "you don't have sufficient permissions" error from Wordpress.

    I just tried to recreate the same problem now but again it didn't happen.

    Sorry I know this isn't very helpful.

  • Adam Czajczyk
    • Support Gorilla

    Hey Melanie,

    I hope you're well today!

    I've just talked to my colleague who's very familiar with Membership 2 code and the idea of switching user roles/memberships at once.

    You said that you're hooking to "ms_model_relationship_create_ms_relationship_before". I understand that this is your custom code so could you please share it with us? I'd apply it to my own sanbox install and my colleague would also take a look at it. I'm sure we'll be able to come up with a solution for you :slight_smile:

    Thanks,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.