[wp-trac] [WordPress Trac] #43018: Multisite: Adding a new user to a site with non-Subscriber role adds Subscriber user

WordPress Trac noreply at wordpress.org
Thu Jan 4 07:08:33 UTC 2018


#43018: Multisite: Adding a new user to a site with non-Subscriber role adds
Subscriber user
-----------------------------+-----------------------------
 Reporter:  willgorham       |      Owner:
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Role/Capability  |    Version:  4.9.1
 Severity:  normal           |   Keywords:
  Focuses:  multisite        |
-----------------------------+-----------------------------
 When attempting to add a new user to a site on a multisite network with
 any role that ''isn't'' Subscriber, the new user is saved as a Subscriber
 no matter what role you select.

 To reproduce:
 - Have a multisite network with some sites.
 - Log in as a super admin, and go to a site dashboard (not the network
 dashboard)
 - Go to Users > Add New
 - In the Add New User section (not Add Existing User) add new user details
 and select a non-Subscriber role.
 - Check the box to skip a confirmation email. Submit the form.
 - View all users and see that the newly created user is a Subscriber

 I came across this issue when developing a plugin which creates a custom
 user role, but this seems to apply regardless of the role type.

 Looking through the codebase, the desired role is submitted correctly into
 {{{POST['role']}}}, and saved into the meta field of the _signups table as
 'new_role'. Then wpmu_activate_signup() is called, which calls
 wpmu_create_user(), and then wp_create_user(), creating a capability-less
 user. The submitted role doesn't look like it's ever handled in user
 creation / linking to

--
Ticket URL: <https://core.trac.wordpress.org/ticket/43018>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list