How to change the current bp-code - advice needed

Hi guys,

receive the following debug errors

Warning: Invalid argument supplied for foreach() in /home/ kar2xpe /public_html/wp-content/plugins/buddypress/bp-members/bp-members-admin.php on line 1941

Notice: bp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). (This message was added in version 1.7.) in /home/kar2xpe/public_html/wp-includes/functions.php on line 3787

Your expertise regards how to change the code would be great:

Current code of html/wp-content/plugins/buddypress/bp-members/bp-members-admin.php on line 1941

// These arguments are added to all URLs.
$url_args = array( 'page' => 'bp-signups' );

// These arguments are only added when performing an action.
$action_args = array(
'action' => 'do_' . $action,
'signup_ids' => implode( ',', $signup_ids )
);

$cancel_url = add_query_arg( $url_args, bp_get_admin_url( 'users.php' ) );
$action_url = wp_nonce_url(
add_query_arg(
array_merge( $url_args, $action_args ),
bp_get_admin_url( 'users.php' )
),
'signups_' . $action
);

?>

<div class="wrap">
<h2><?php echo esc_html( $header_text ); ?></h2>
<p><?php echo esc_html( $helper_text ); ?></p>

<ol class="bp-signups-list">
<?php foreach ( $signups as $signup ) :

$last_notified = mysql2date( 'Y/m/d g:i:s a', $signup->date_sent ); ?>

  • <?php echo esc_html( $signup->user_name ) ?> - <?php echo sanitize_email( $signup->user_email );?>

    <?php if ( 'resend' == $action ) : ?>

    <p class="description">
    <?php printf( esc_html__( 'Last notified: %s', 'buddypress'), $last_notified ) ;?>

    <?php if ( ! empty( $signup->recently_sent ) ) : ?>

    <span class="attention wp-ui-text-notification"> <?php esc_html_e( '(less than 24 hours ago)', 'buddypress' ); ?></span>

    <?php endif; ?>
    </p>

    <?php endif; ?>

  • <?php endforeach; ?>

    <?php if ( 'delete' === $action ) : ?>

    <p><?php esc_html_e( 'This action cannot be undone.', 'buddypress' ) ?></p>

    <?php endif ; ?>

    "><?php esc_html_e( 'Confirm', 'buddypress' ); ?>
    "><?php esc_html_e( 'Cancel', 'buddypress' ) ?>
    </div>

    <?php
    }
    }
    endif; // End class_exists check.

    // Load the BP Members admin.
    add_action( 'bp_init', array( 'BP_Members_Admin', 'register_members_admin' ) );

    Thank you.