[wp-trac] [WordPress Trac] #61100: Fix capability error in bulk role removal when editing site users in network admin

WordPress Trac noreply at wordpress.org
Thu Mar 20 05:10:49 UTC 2025


#61100: Fix capability error in bulk role removal when editing site users in
network admin
-------------------------------------+-------------------------------------
 Reporter:  ignatiusjeroe            |       Owner:  jeremyfelt
     Type:  defect (bug)             |      Status:  assigned
 Priority:  normal                   |   Milestone:  6.8
Component:  Networks and Sites       |     Version:  3.1
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:  administration,
  has-testing-info has-unit-tests    |  multisite
-------------------------------------+-------------------------------------
Changes (by tusharaddweb):

 * keywords:  has-patch needs-testing has-testing-info => has-patch needs-
     testing has-testing-info has-unit-tests
 * focuses:  multisite => administration, multisite


Comment:

 Test Environment:
         WordPress Version: 6.8

 Test Scenario

     Navigate to Network Admin → Sites → Edit Site → Users (wp-
 admin/network/site-users.php?id=xxx).
     Select "-No role for this site-" from the dropdown for a user.
     Click Change to update the user’s role.
     Observe if an error occurs.
     Repeat the same test in Users (wp-admin/users.php) to compare
 behavior.

 Expected Result

     Selecting "-No role for this site-" should remove the user’s role
 without triggering an error.

 Actual Result (Before Patch)

     An error occurs when selecting "-No role for this site-" on wp-
 admin/network/site-users.php.
     No error occurs when performing the same action on wp-admin/users.php.
     Root Cause:
         The value "none" is not present in $editable_roles.
         The if-statement at line 145 fails, causing the error.

 Result (After Applying Patch)

     ✅ Issue Resolved when selecting "-No role for this site-" for a non-
 admin user.
     ❌ Error still occurs when removing the main admin’s role.
     The issue persists when attempting to remove the network administrator
 role.

 Attachments

   https://prnt.sc/rTqkml0PKI-J
   https://prnt.sc/m3TJW-OpS5Hi

 Test Conclusion

     Status: 🟡 Partially Fixed
     Impact: Medium (Affects user role management in Multisite,
 particularly for admins)
     Recommendation:
         Investigate the issue when removing the main admin’s role.
         Modify the patch to handle cases where the admin role is being
 modified.
         Ensure consistency between network admin user management and
 single-site user management.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61100#comment:27>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list