Skip to:
Content

BuddyPress.org

Changeset 1293


Ignore:
Timestamp:
04/01/2009 07:31:34 PM (16 years ago)
Author:
apeatling
Message:

fixed profile data deletion bug

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups.php

    r1291 r1293  
    2626require ( 'bp-groups/bp-groups-widgets.php' );
    2727require ( 'bp-groups/bp-groups-filters.php' );
     28
     29
    2830
    2931/**************************************************************************
     
    132134    if ( !$no_global )
    133135        global $bp;
     136       
     137   
    134138   
    135139    $bp->groups->table_name = $wpdb->base_prefix . 'bp_groups';
     
    10941098               
    10951099                $content = apply_filters( 'bp_groups_new_forum_topic_activity', $content, $user_link, $group_link, $forum_topic['topic_id'], $forum_topic['topic_title'], $group_link, $group->name, $post_content );
    1096 
     1100               
    10971101                return array(
    10981102                    'primary_link' => $group_link,
  • trunk/bp-xprofile.php

    r1290 r1293  
    675675                           
    676676                            // Create a new profile data object for the logged in user based on field ID.                               
    677                             $profile_data = new BP_Xprofile_ProfileData( $group->fields[$j]->id );
     677                            $profile_data = new BP_Xprofile_ProfileData( $group->fields[$j]->id, $bp->loggedin_user->id );
    678678                           
    679                             // Delete any data
    680                             $profile_data->delete();
     679                            if ( $profile_data ) {                 
     680                                // Delete any data
     681                                $profile_data->delete();
     682                               
     683                                // Also remove any selected profile field data from the $field object.
     684                                $field->data->value = null;
     685                            }
    681686                           
    682                             // Also remove any selected profile field data from the $field object.
    683                             $field->data->value = null;
    684                        
    685687                        // If we get to this point then the field validates ok and we have new data.
    686688                        } else {
  • trunk/bp-xprofile/bp-xprofile-classes.php

    r1280 r1293  
    999999       
    10001000        $sql = $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d", $field_id, $user_id );
    1001 
     1001       
    10021002        if ( $profiledata = $wpdb->get_row($sql) ) {
     1003           
    10031004            $this->id = $profiledata->id;
    10041005            $this->user_id = $profiledata->user_id;
     
    10611062        global $wpdb, $bp;
    10621063       
     1064        var_dump($wpdb->prepare( "DELETE FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d", $this->field_id, $this->user_id ));
     1065       
    10631066        if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d", $this->field_id, $this->user_id ) ) )
    10641067            return false;
Note: See TracChangeset for help on using the changeset viewer.