• When using this plugin (v4.3) with BuddyBoss (v2.6.70), there’s a PHP Fatal error when saving changes on the “Login Information” page on the “Account Settings” section. This page allows the updating of the email or the password, and shows the 2FA activation options. After looking through the code, the problem is with this hook (login-with-ajax/2FA/2FA-account.php:32):

    add_action('bp_core_general_settings_after_save', array( static::class, 'bp_save_profile_fields' ), 10, 2 );

    The function expects 2 arguments (login-with-ajax/2FA/2FA-account.php:102):

    public static function bp_save_profile_fields( $user_id, $redirect_to ) { ... }

    But if we look for the hook definition, there’s no arguments (buddyboss-platform/bp-settings/actions/general.php:317):

    do_action( 'bp_core_general_settings_after_save' );

    I’ve got it working deleting the arguments on the function and adding this:

    • Setting the $user_id inside the function: $user_id = bp_displayed_user_id();
    • Commenting the redirect as it’s not necessary: //bp_core_redirect( $redirect_to );

    I suppose a better approach would be to make both arguments nullable (if they are available in vanilla BuddyPress) and apply the mentioned changes when detecting any of them as null.

    Thanks for this amazing plugin. The UI integration with BuddyBoss is outstanding.

  • The topic ‘PHP Fatal error with BuddyBoss’ is closed to new replies.