Skip to:
Content

BuddyPress.org

Changeset 5778


Ignore:
Timestamp:
02/13/2012 08:45:48 PM (15 years ago)
Author:
boonebgorges
Message:

Use field_id 1 when checking for existing fullname in bp_core_get_user_displayname() fallback, to avoid mismatches in bp-xprofile-fullname-field-name site option.
Don't overwrite bp-xprofile-fullname-field-name and bp-xprofile-base-group-name during upgrade if they're already populated.
Fixes #3725

Location:
branches/1.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.5/bp-core/admin/bp-core-schema.php

    r4820 r5778  
    206206        $bp_prefix = bp_core_get_table_prefix();
    207207
    208         bp_update_option( 'bp-xprofile-base-group-name', _x( 'Base', 'First XProfile group name', 'buddypress' ) );
    209         bp_update_option( 'bp-xprofile-fullname-field-name', _x( 'Name', 'XProfile fullname field name', 'buddypress' ) );
     208        // These values should only be updated if they are not already present
     209        if ( !$base_group_name = bp_get_option( 'bp-xprofile-base-group-name' ) ) {
     210                bp_update_option( 'bp-xprofile-base-group-name', _x( 'Base', 'First XProfile group name', 'buddypress' ) );
     211        }
     212
     213        if ( !$fullname_field_name = bp_get_option( 'bp-xprofile-fullname-field-name' ) ) {
     214                bp_update_option( 'bp-xprofile-fullname-field-name', _x( 'Name', 'XProfile fullname field name', 'buddypress' ) );
     215        }
    210216
    211217        $sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_groups (
  • branches/1.5/bp-members/bp-members-functions.php

    r5626 r5778  
    408408        if ( !$fullname = wp_cache_get( 'bp_user_fullname_' . $user_id, 'bp' ) ) {
    409409                if ( bp_is_active( 'xprofile' ) ) {
    410                         $fullname = xprofile_get_field_data( stripslashes( $bp->site_options['bp-xprofile-fullname-field-name'] ), $user_id );
     410                        $fullname = xprofile_get_field_data( 1, $user_id );
    411411
    412412                        if ( empty($fullname) ) {
Note: See TracChangeset for help on using the changeset viewer.