[wp-trac] [WordPress Trac] #34495: Negative number for "No role"?

WordPress Trac noreply at wordpress.org
Fri Oct 30 16:34:48 UTC 2015


#34495: Negative number for "No role"?
-------------------------------+------------------------------
 Reporter:  pavelevap          |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  General            |     Version:  trunk
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by pavelevap):

 So, I tried to debug it a little bit and problem is here:
 https://core.trac.wordpress.org/browser/trunk/src/wp-includes/user-
 functions.php#L779

 `$role_counts['none'] = ( $total_users - array_sum( $role_counts ) );`

 This logic does not work for me.

 `$role_counts`:

 `array(5) { ["administrator"]=> int(1) ["editor"]=> int(1) ["author"]=>
 int(2) ["subscriber"]=> int(7) ["bbp_keymaster"]=> int(1) }`

 `array_sum( $role_counts )`: `int(12)`

 `$total_users`: `int(11)`

 Result is '''-1'''

 bbPress plugin is deactivated, but was active before and Administrator is
 also Keymaster.

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


More information about the wp-trac mailing list