• Hello,

    I am getting a fatal error when trying to look at pending user profiles. When I bring up the “Member Requests” page, these two errors are displayed:

    Please approve or deny the following new members:
    
    Notice: Undefined index: Name in /home/sites/2a/8/819378a23a/public_html/wp-content/plugins/buddypress/bp-core/classes/class-bp-core-user.php on line 159
    
    Notice: Trying to access array offset on value of type null in /home/sites/2a/8/819378a23a/public_html/wp-content/plugins/buddypress/bp-core/classes/class-bp-core-user.php on line 159

    And when clicking on one of the pending member usernames, I get this error:

    Fatal error: Uncaught Error: Call to undefined function bp_nouveau() in /home/sites/2a/8/819378a23a/public_html/wp-content/plugins/bp-registration-options/includes/core.php:921 Stack trace: #0 /home/sites/2a/8/819378a23a/public_html/wp-includes/class-wp-hook.php(307): bpro_nouveau_friend_button_hide(Array) #1 /home/sites/2a/8/819378a23a/public_html/wp-includes/plugin.php(189): WP_Hook->apply_filters(Array, Array) #2 /home/sites/2a/8/819378a23a/public_html/wp-content/plugins/buddypress/bp-friends/bp-friends-template.php(458): apply_filters('bp_get_add_frie...', Array) #3 /home/sites/2a/8/819378a23a/public_html/wp-content/plugins/buddypress/bp-friends/bp-friends-template.php(361): bp_get_add_friend_button(166, false) #4 /home/sites/2a/8/819378a23a/public_html/wp-includes/class-wp-hook.php(307): bp_add_friend_button('') #5 /home/sites/2a/8/819378a23a/public_html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array) #6 /home/sites/2a/8/819378a23a/public_html/wp-includes/plugin.php(474): WP_Hook->do_action(Arra in /home/sites/2a/8/819378a23a/public_html/wp-content/plugins/bp-registration-options/includes/core.php on line 921
    There has been a critical error on this website.

    WordPress and all plugins are updated. php version is 7.4.

    Would appreciate some guidance on this problem.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    Looks like I missed doing some extra checks for functions existing.

    Are you comfortable with editing the plugin yourself temporarily? or would you prefer we provide a hopefully patched up version to confirm a fix, before releasing to everyone?

    Thread Starter DarthTater

    (@darthtater)

    I should be able to edit the plugin with some hand-holding.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Alright,

    So the includes/core.php file in bp-registration-options has a function at the end that looks like the one shown at this url:

    https://github.com/WebDevStudios/BuddyPress-Registration-Options/blob/master/includes/core.php#L914-L926

    Make it look like this:

    function bpro_nouveau_friend_button_hide( $args ) {
    	if ( ! function_exists( 'bp_nouveau' ) ) {
    		return $args;
    	}
    	$moderated = bp_registration_get_moderation_status( get_current_user_id() );
    	if ( function_exists( 'bp_displayed_user_id' ) ) {
    		$displayed_moderated = bp_registration_get_moderation_status( bp_displayed_user_id() );
    	}
    
    	if ( $moderated || $displayed_moderated ) {
    		if ( 'friends' === bp_nouveau()->members->button_args['component'] ) {
    			bp_nouveau()->members->button_args = [];
    		}
    	}
    }
    

    Note the extra code added before the $moderated line.

    Also, out of curiosity, are you on BuddyPress, or are you perhaps using BuddyBoss? Curious if they maybe don’t have the Nouveau theme functionality in their fork.

    Thread Starter DarthTater

    (@darthtater)

    Hi Michael,

    I don’t have BuddyBoss. BuddyPress works ok for what my small non-profit client needs.

    I will try that code out later today or tomorrow. Thank you for providing that.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Noted on it not being BuddyBoss. We’ve been getting a mix of both over the past year or two, which is why I asked.

    We’ll be here when ready.

    Thread Starter DarthTater

    (@darthtater)

    That worked. Thank you very much!

    BTW, when I click on a requesting person’s user name, it takes me to their personal page. What I need to look at in order to approve or deny, is actually their profile on that page. Maybe consider changing that link in the next iteration. It would just save another click & page load.

    Thank you again for making this plugin available.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Good to know that it fixed the issue.

    Regarding the linking, I’ll consider it. The way it is now may prove useful to some already, so I could see myself potentially linking to both instead of one or the other. I’ll ponder it.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Errors when trying to approve members’ is closed to new replies.