[buddypress-trac] [BuddyPress Trac] #5214: groups_create_group() improvements
buddypress-trac
noreply at wordpress.org
Tue Mar 25 18:30:10 UTC 2014
#5214: groups_create_group() improvements
----------------------------------------+------------------
Reporter: r-a-y | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 2.0
Component: Groups | Version: 1.0
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests |
----------------------------------------+------------------
Comment (by boonebgorges):
Had another look. This is mostly good. I'm going to make a few changes:
- We should not be bailing on `if ( empty( $creator_id ) )`. This is a
change from our current behavior. It breaks dozens of our unit tests,
which suggests it'll break real-life uses. In practice, a creator_id will
always be set in the user interface because it falls back on
`bp_loggedin_user_id()`; this, of course, will be 0 when groups are
created programatically. That said, there is nothing particularly invalid
about a group without a creator - it's not as if BP breaks in any way. So
let's skip the check altogether.
- IMO, checking for a valid `status` is not appropriate for the DB class.
It's not totally clear to me what the purpose of this whitelist is in
general, but in any case, having an "invalid" status will not render a
group unusable. So I'm going to move it up to `groups_create_group()`.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5214#comment:6>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list