User Profile update user role overwrites additional roles

Support MB User Profile User Profile update user role overwrites additional roles

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #38902
    Denise FieldDenise Field
    Participant

    Hi

    I've set up a custom field called 'role' with one select field, so that they can change their main user role to um_member (Member).

    So I have 2 Questions:-
    1. It does work, pressing submit changes the role to um_member, but it overwrites all additional user roles.. for example I have users that are both Members and Customers. ideally I want to append this role, if its not already in the role list, not overwrite the whole field in the database.

    2. I added a rule to show the field for only certain user roles, but its not working, HERE IS THE RULE
    And here is the Change Role profile form STILL SHOWING even though the role is now Member, which is not in the rule.

    Thanks for any help

    #38915
    Long NguyenLong Nguyen
    Moderator

    Hi,

    1. The default field role works similarly to the role in the WordPress backend, one user can have one role only.

    2. The extension MB Include Exclude only works in the admin area, it does not work with the shortcode in the frontend. I will inform the development team to consider supporting this case in future updates.

    #38928
    Denise FieldDenise Field
    Participant

    I see, I will probably have to make it a manual request for now then via email because I have am using the plugins USER ROLE EDITOR, YITH AFFILIATES and WOOCOMMERCE all of these add user roles to the main one.

    Thank you for your consideration of this in future updates though.

    #38929
    Denise FieldDenise Field
    Participant

    Just one more thing, if your Devs do include it, all they need to do is to ensure that the record is not completely overwritten

    Other plugins have added user roles this is how the usermeta looks:

    a:3:{s:8:"customer";b:1;s:14:"yith_affiliate";b:1;s:9:"um_member";b:1;}

    So, something like if the role to be added does not exist, then add it, not overwrite the original, especially as woocommerce adds customer as the primary user and relegates all others.

    Hope that helps with the dev.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.