[buddypress-trac] [BuddyPress Trac] #9227: Fatal error due to bp_get_object_terms function
buddypress-trac
noreply at wordpress.org
Mon Aug 19 16:36:14 UTC 2024
#9227: Fatal error due to bp_get_object_terms function
--------------------------+---------------------
Reporter: raviousprime | Owner: (none)
Type: defect (bug) | Status: new
Priority: high | Milestone: 14.1.0
Component: Core | Version:
Severity: critical | Resolution:
Keywords: |
--------------------------+---------------------
Comment (by raviousprime):
Hello
Complete error code
{{{
[19-Aug-2024 16:33:42 UTC] PHP Fatal error: Uncaught TypeError:
array_merge(): Argument #2 must be of type array, WP_Error given in
/var/www/bp/support/wp-content/plugins/buddypress/bp-core/bp-core-
taxonomy.php:171
Stack trace:
#0 /var/www/bp/support/wp-content/plugins/buddypress/bp-core/bp-core-
taxonomy.php(171): array_merge()
#1 /var/www/bp/support/wp-content/plugins/buddypress/bp-members/bp-
members-functions.php(3197): bp_get_object_terms()
#2 /var/www/bp/support/wp-content/plugins/bp-custom.php(22):
bp_get_member_type()
#3 /var/www/bp/support/wp-includes/class-wp-hook.php(324):
BuddyPress->{closure}()
#4 /var/www/bp/support/wp-includes/plugin.php(205):
WP_Hook->apply_filters()
#5 /var/www/bp/support/wp-content/mu-plugins/user-switching.php(374):
apply_filters()
#6 /var/www/bp/support/wp-content/mu-plugins/user-switching.php(194):
user_switching::get_redirect()
#7 /var/www/bp/support/wp-includes/class-wp-hook.php(324):
user_switching->action_init()
#8 /var/www/bp/support/wp-includes/class-wp-hook.php(348):
WP_Hook->apply_filters()
#9 /var/www/bp/support/wp-includes/plugin.php(517): WP_Hook->do_action()
#10 /var/www/bp/support/wp-settings.php(700): do_action()
#11 /var/www/bp/support/wp-config.php(99): require_once('...')
#12 /var/www/bp/support/wp-load.php(50): require_once('...')
#13 /var/www/bp/support/wp-login.php(12): require('...')
#14 {main}
thrown in /var/www/bp/support/wp-content/plugins/buddypress/bp-core/bp-
core-taxonomy.php on line 171
}}}
PHP Code
{{{#!php
<?php
add_filter( 'login_redirect', function ( $redirect_to_calculated,
$redirect_url_specified, $user ) {
if ( ! $user || is_wp_error( $user ) ) {
return $redirect_to_calculated;
}
$member_type = bp_get_member_type( $user->ID, true );
if ( ! $member_type ) {
return '';
}
return $redirect_to_calculated;
}, 111, 3 );
}}}
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/9227#comment:4>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list