500: post_status no array
-
Hey guys,
I get a 500 error after the latest update:
AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: [] operator not supported for strings in /var/www/vhosts/<url>/wp-content/plugins/bbpress/includes/forums/functions.php:1800 Stack trace: #0 /var/www/vhosts/<url>/wp-includes/class-wp-hook.php(298): bbp_pre_get_posts_normalize_forum_visibility(Object(WP_Query)) #1 /var/www/vhosts/<url>/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters('', Array) #2 /var/www/vhosts/<url>/wp-includes/plugin.php(515): WP_Hook->do_action(Array) #3 /var/www/vhosts/<url>/wp-includes/class-wp-query.php(1681): do_action_ref_array('pre_get_posts', Array) #4 /var/www/vhosts/<url>/wp-includes/class-wp-query.php(3238): WP_Query->get_posts() #5 /var/www/vhosts<url>/wp-includes/class-wp.php(617): WP_Query->query(Array) #6 /var/www/vhosts/<url>/wp-includes/clas...'
ln 1800 looks like this:
$post_stati = $posts_query->get( 'post_status' ); // Default to public status if ( empty( $post_stati ) ) { $post_stati[] = bbp_get_public_status_id(); // Split the status string } elseif ( is_string( $post_stati ) ) { $post_stati = explode( ',', $post_stati ); }
could be fixed by forcing the array:
$post_stati = $posts_query->get( 'post_status' ); if (!is_array($post_stati)){ $post_stati = array($post_stati); } // Default to public status if ( empty( $post_stati ) ) { $post_stati[] = bbp_get_public_status_id(); // Split the status string } elseif ( is_string( $post_stati ) ) { $post_stati = explode( ',', $post_stati ); }
side note: wp version 4.7.4, bbpress version 2.5.12
Thanks in advance,
Toby
Viewing 18 replies - 1 through 18 (of 18 total)
Viewing 18 replies - 1 through 18 (of 18 total)
- You must be logged in to reply to this topic.