[buddypress-trac] [BuddyPress] #2640: BP_XProfile_Group::get() is restrictive

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Sat Sep 18 00:52:35 UTC 2010

#2640: BP_XProfile_Group::get() is restrictive
 Reporter:  r-a-y     |       Owner:           
     Type:  defect    |      Status:  new      
 Priority:  normal    |   Milestone:  1.2.6    
Component:  XProfile  |    Keywords:  has-patch
 I'm working on a plugin which makes use of the "parent_id" parameter in
 the $bp->profile->table_name_fields table.

 However, BP_XProfile_Group::get() doesn't return the "parent_id" if
 "fetch_fields" is set to true.

 BP_XProfile_Group::get() also limits fields whose "parent_id" is 0, which
 defeats the purpose of my plugin.

 There are a few ways to open this up.

 Option 1: Change line 117 in bp-xprofile-classes.php to:

 $fields = $wpdb->get_results( $wpdb->prepare( "SELECT id, name,
 description, type, group_id, parent_id, is_required FROM
 {$bp->profile->table_name_fields} WHERE group_id IN ( {$group_ids} ) ORDER
 BY field_order" ) );

 Option 2: Filter $fields SQL query, see attached patch.


 Would like to see this in BP 1.2.6, but understand if this should be moved
 to BP 1.3.

Ticket URL: <http://trac.buddypress.org/ticket/2640>
BuddyPress <http://buddypress.org/>

More information about the buddypress-trac mailing list