[wp-trac] [WordPress Trac] #18934: Multisite issue cleaning up empty capabilities

WordPress Trac noreply at wordpress.org
Thu Nov 21 07:15:57 UTC 2013


#18934: Multisite issue cleaning up empty capabilities
--------------------------+-----------------------
 Reporter:  jammitch      |       Owner:  PeteMall
     Type:  defect (bug)  |      Status:  accepted
 Priority:  normal        |   Milestone:  3.8
Component:  Multisite     |     Version:  3.0
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+-----------------------

Comment (by jeremyfelt):

 Chiming in with conjecture.

 This behavior was introduced in
 [http://mu.trac.wordpress.org/changeset/797 mu:797] with the commit
 message "WP Merge - needs testing."

 This appears to be continued work on the merge from WordPress core to WPMU
 done in [http://mu.trac.wordpress.org/changeset/770 mu:770] as well as
 other changesets in that time period.

 This added behavior appears to imply that `$errors = edit_user($user_id);`
 was adding something that WPMU did not want and had to work around. I
 think it originates with #1825, but I haven't wrapped my head around it
 yet.

 Basically:
 1. If this user has no WPMU specified role on this site (indicated by the
 empty caps array)...
 2. Assume site capabilities were added for the user in `edit_user()` by
 WordPress core functionality...
 3. And remove all capabilities for this user on this site after
 `edit_user()` is complete.

 As we don't store empty capabilities for user/site relationships, I do
 think this is a harmless removal. It seems that the only way it could be
 harmful is if another place in WordPress core is expecting an empty
 capabilities array.

 If it's going to land in 3.8, it should go soon so that we can confirm. I
 can't imagine a way to unit test this right now.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/18934#comment:23>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list