[buddypress-trac] [BuddyPress Trac] #6734: `groups_get_groups()` doesn't distinguish between `0` and falsey values for `user_id`

buddypress-trac noreply at wordpress.org
Sat Nov 21 19:55:05 UTC 2015


#6734: `groups_get_groups()` doesn't distinguish between `0` and falsey values for
`user_id`
-------------------------------------------------+-------------------------
 Reporter:  boonebgorges                         |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Under
Component:  Component - Groups                   |  Consideration
 Severity:  normal                               |     Version:
 Keywords:  2nd-opinion needs-patch needs-unit-  |  Resolution:
  tests                                          |
-------------------------------------------------+-------------------------
Changes (by DJPaul):

 * milestone:  Awaiting Review => Under Consideration


Comment:

 This is tricky.

 If I write code and try to use the current user, I think I would normally
 check to see if `is_user_logged_in` first, even if it's somewhere that
 ought to only get reached if the user is logged in.

 Assuming the above, if I were writing a function like `groups_get_groups`
 today, would I support the argument change you propose? Probably I would,
 because it doesn't hurt, and especially if I were also supporting a
 negative integer (i.e. for groups this user ID is *not* a member of).

 Backwards compatibility here would be my main concern. I think we'd need
 to do some research in plugins and see what would happen if the change
 were made.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6734#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list