WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#14708 closed defect (bug) (fixed)

Do not set role if it is the same

Reported by: nickmomrik Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.0.1
Component: Role/Capability Keywords:
Focuses: Cc:

Description

When set_role is called it doesn't check to see if the role is changing. So we can update the user and fire the set_user_role action even when nothing is changing.

To reproduce go to the Users screen and "change" the role of an Administrator to an Administrator. Or use wp-admin/ms-sites.php to update options. The user will be updated and the set_user_role action fires.

Attachments (1)

set-role.diff (520 bytes) - added by nickmomrik 4 years ago.
Possible fix

Download all attachments as: .zip

Change History (5)

nickmomrik4 years ago

Possible fix

comment:1 nickmomrik4 years ago

  • Cc nickmomrik added

comment:3 ryan4 years ago

  • Milestone changed from Awaiting Review to 3.1

comment:4 ryan4 years ago

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.