Skip to:
Content

BuddyPress.org

Changeset 12503


Ignore:
Timestamp:
12/06/2019 06:44:36 PM (5 years ago)
Author:
imath
Message:

Make sure users can register when the xProfile component is not active

In version 5.0.0, we've introduced an improvement to use the display name as the salutation in signup emails (see [12349]). To do so we rely on an xProfile's component function. When this component is not active, the function is also not available causing a fatal error and preventing the activation email to be sent. To fix this issue we are now checking the component is active before using the function to return the display name.

See #8174 (Trunk)

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-filters.php

    r12349 r12503  
    478478
    479479    $salutation = $user;
    480     if ( $signups ) {
     480    if ( $signups && bp_is_active( 'xprofile' ) ) {
    481481        $signup = $signups['signups'][0];
    482482        if ( isset( $signup->meta[ 'field_' . bp_xprofile_fullname_field_id() ] ) ) {
     
    540540
    541541    $salutation = $user;
    542     if ( isset( $meta[ 'field_' . bp_xprofile_fullname_field_id() ] ) ) {
     542    if ( bp_is_active( 'xprofile' ) && isset( $meta[ 'field_' . bp_xprofile_fullname_field_id() ] ) ) {
    543543        $salutation = $meta[ 'field_' . bp_xprofile_fullname_field_id() ];
    544544    } elseif ( $user_id ) {
  • trunk/src/bp-members/bp-members-functions.php

    r12450 r12503  
    17771777        if ( apply_filters( 'bp_core_signup_send_activation_key', true, $user_id, $user_email, $activation_key, $usermeta ) ) {
    17781778            $salutation = $user_login;
    1779             if ( isset( $usermeta[ 'field_' . bp_xprofile_fullname_field_id() ] ) ) {
     1779            if ( bp_is_active( 'xprofile' ) && isset( $usermeta[ 'field_' . bp_xprofile_fullname_field_id() ] ) ) {
    17801780                $salutation = $usermeta[ 'field_' . bp_xprofile_fullname_field_id() ];
    17811781            }
  • trunk/src/bp-members/classes/class-bp-signup.php

    r12349 r12503  
    641641                } else {
    642642                    $salutation = $signup->user_login;
    643                     if ( isset( $meta[ 'field_' . bp_xprofile_fullname_field_id() ] ) ) {
     643                    if ( bp_is_active( 'xprofile' ) && isset( $meta[ 'field_' . bp_xprofile_fullname_field_id() ] ) ) {
    644644                        $salutation = $meta[ 'field_' . bp_xprofile_fullname_field_id() ];
    645645                    }
Note: See TracChangeset for help on using the changeset viewer.