• I believe I have found a bug that has been introduced during an update at some stage (it used to work)

    I hope the description below is clear and sufficient.

    I would appreciate if you can tell me if this is reproducible, fixable and if there is any workaround in the meantime.

    UM version 2.1.20 and 2.2.0 and 2.2.2
    Wordpress version 5.8
    Theme = Divi version 4.9.10

    1. I use a profile form that uses the pre-defined field ‘Role (dropdown)’
    2. The field ‘Can user edit this field?’ is NOT checked as I don’t want users to edit their own roles
    3. The role field is visible and not editable when the user is editing their own profile (as you would expect)
    4. Editing the users profile page as Admin, the role field is editable. (as you would expect)
    5. When changing the users role and saving the profile, the role reverts to its original value. (not helpful)

    There are no relevant errors in the debug.log file.

    When investigating, I have tried the following:

    1. Check the ‘Can user edit this field?’ checkbox:
    The result is that both user and admin can change the role. (but this is not the behaviour that I want)

    2. In code, Add the UM action ‘um_user_pre_updating_profile’
    The array passed to the function contains a [role] element when ‘Can user edit this field?’ is checked but [role] element is missing when not checked.

    3. In code, add the WordPress Action ‘set_user_role’.
    This action is called when ‘Can user edit this field?’ is checked but is not called when not checked.

    Thanks in advance,
    – Jerry

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @jerrystewart99

    Are you assigning a role with administrative capabilities or they are just subscriber-level roles?

    Regards,

    Thread Starter jerrystewart99

    (@jerrystewart99)

    Hi @champsupertramp

    Thanks for you reply.

    The roles being assigned are all UM roles and do not have admin access.
    WP-Admin Access is set to ‘No’
    UM Custom Role is set to ‘Yes’
    Role ID’s all start with um_

    Regards,
    – Jerry

    @champsupertramp @jerrystewart99
    We are having this issue also. The role does not change if we try to change it via the profile edit form.

    Did you ever find a solution?

    • This reply was modified 3 years, 1 month ago by ermWP.
    Milton Friedman

    (@professormilt)

    I am having the same issue. Also using UM. Once a new registrant is assigned the default “user” role, when we change that role to anything else, it reverts to “user”.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @professormilt

    Where do you change the role? Is it in WP-Admin > Users screen?

    Regards,

    Thread Starter jerrystewart99

    (@jerrystewart99)

    Hi @champsupertramp

    I note that this issue is still broken in version 2.8.1

    I’m just wondering what the the status of this bug and when is it likely to get fixed.

    Thanks
    – Jerry

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Admin unable to change role in user profile if ‘Can user edit field’ not set’ is closed to new replies.