• When editing a users roles, the same roles are set to the executing user. Example:
    User: Frank
    User ID: 1234
    Roles: administrator

    Edit User Ryan with user id 4321 to have roles Editor only

    Outcome: both users (Frank & Ryan) have Editor only roles.

    Unsure how/why this is happening.

Viewing 3 replies - 1 through 3 (of 3 total)
  • This is not a default WordPress behavior. Can you provide details of how you are editing user roles? Are you using the default wordpress interface? Do you have a plugin to edit roles? Or are you doing manually in PHP or mySQL? What are the steps you follow?

    Thread Starter frankbaris

    (@frankbaris)

    I agree this is not default behavior. I am editing user roles via the default wordpress interface. If I change user roles via direct database SQL updates, I get normal behavior. Also, if I set or add roles using wp-cli, I too get normal behavior. This issue is strictly when using the default wordpress interface. I do have the Members plugin by MemberPress installed which is used to create additional roles.

    Also, this behavior was recently introduced just two days ago. We have two roles that are added to customers (hero, military) that we use to award additional discounts in WooCommerce to front-line/medical/military and we have one person at the company responsible for this, and he edits the roles of users everyday without issue until just two days ago.

    I know standard troubleshooting would entail disabling plugins (especially any that were updated in the past few days) but the site is a live production ecommerce site so I do not want to do that.

    Any advise? Any insight in to how I can see what SQL statement is called when the page/form is submitted. I assume its called from “wp-admin/user-edit.php” — ideas??

    TIA

    • This reply was modified 4 years, 2 months ago by frankbaris.
    Thread Starter frankbaris

    (@frankbaris)

    I turned on direct to file SQL debugging and found that all functions/calls were being called twice with the edited users user-id as well as the logged in users user-id. After hours of trying to figure out what would cause this … I did the first thing I should have done and went back to see what new plugins were installed prior to the issue presenting … and… it’s WooCommerce Anti-Fraud plugin — I have a ticket open with them now, and I will update this as I have more information.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘edit user; changes role of executing user as well’ is closed to new replies.