Skip to:
Content

BuddyPress.org

Ticket #5755: 5755.patch

File 5755.patch, 1.7 KB (added by Viper007Bond, 12 years ago)
  • bp-xprofile/bp-xprofile-screens.php

     
    108108                                // Certain types of fields (checkboxes, multiselects) may come through empty. Save them as an empty array so that they don't get overwritten by the default on the next edit.
    109109                                $value = isset( $_POST['field_' . $field_id] ) ? $_POST['field_' . $field_id] : '';
    110110
    111                                 if ( !xprofile_set_field_data( $field_id, bp_displayed_user_id(), $value, $is_required[$field_id] ) ) {
    112                                         $errors = true;
    113                                 } else {
    114                                         do_action( 'xprofile_profile_field_data_updated', $field_id, $value );
    115                                 }
    116 
    117                                 // Save the visibility level
    118111                                $visibility_level = !empty( $_POST['field_' . $field_id . '_visibility'] ) ? $_POST['field_' . $field_id . '_visibility'] : 'public';
    119                                 xprofile_set_field_visibility_level( $field_id, bp_displayed_user_id(), $visibility_level );
    120112
    121113                                // Save the old and new values. They will be
    122114                                // passed to the filter and used to determine
     
    129121                                        'value'      => $value,
    130122                                        'visibility' => $visibility_level,
    131123                                );
     124
     125                                if ( !xprofile_set_field_data( $field_id, bp_displayed_user_id(), $value, $is_required[$field_id] ) ) {
     126                                        $errors = true;
     127                                } else {
     128                                        do_action( 'xprofile_profile_field_data_updated', $field_id, $value );
     129                                }
     130
     131                                // Save the visibility level
     132                                xprofile_set_field_visibility_level( $field_id, bp_displayed_user_id(), $visibility_level );
    132133                        }
    133134
    134135                        do_action( 'xprofile_updated_profile', bp_displayed_user_id(), $posted_field_ids, $errors, $old_values, $new_values );