[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
Fri Mar 14 10:29:33 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 has-         |     Focuses:  multisite
  testing-info                                   |
-------------------------------------------------+-------------------------

Comment (by ugyensupport):

 == Fix capability error in bulk role removal when editing site users in
 network admin
 === Description
 when selecting the option '-No role for this site-' on page wp-
 admin/network/site-users.php?id=xxx triggers an error. This should not be
 the case. This field is also available on wp-admin/users.php but this
 doesnt trigger an error.

 Bug
 See wp-admin/network/site-users.php @ line 140-183. This case 'promote'
 handles this request. The issue is the value=none of '-No role for this
 site-', which is not found in $edible_roles. The if-statement on line 145
 will cause the error.

 Solution
 The case 'promote' of wp-admin/users.php @ line 110-170 is almost
 identical to that of wp-admin/network/site-users.php?id=xxx. But this
 statement took the 'none' value into account.
 wp-admin/network/site-users.php line 145 - 147 should be replaced by wp-
 admin/users.php lines 125-136

 Patch tested: https://patch-diff.githubusercontent.com/raw/WordPress
 /wordpress-develop/pull/6470.diff

 ===  Steps to Reproduce
 Go to Users
 Select user
 Click on "Chang role to..." and Select "No role for this site"

 === Environment
 - WordPress: 6.8-beta2
 - PHP: 8.4.1
 - Server: nginx/1.21.4
 - Database: mysqli (Server: 5.7.44-log / Client: mysqlnd 8.4.1)
 - Browser: Chrome 134.0.0.0
 - OS: macOS
 - Theme: Twenty Twenty-Five 1.1
 - MU Plugins: None activated
 - Plugins:
   * Test Reports 1.2.0

 === Actual Results
 1.  ✅ Issue resolved with patch.

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


More information about the wp-trac mailing list