• Hello!

    I’m reporting a bug we encountered while reviewing our website logs:

    [11-Mar-2026 15:27:46 UTC] PHP Fatal error: Uncaught TypeError: Yoast\WP\SEO\Schema_Aggregator\User_Interface\Site_Schema_Response_Header_Integration::serve_custom_response(): Return value must be of type bool, null returned in /home/customer/www/domain.example/public_html/wp-content/plugins/wordpress-seo/src/schema-aggregator/user-interface/site-schema-response-header-integration.php:62

    It seems that in the following function:

    public function serve_custom_response( $served, $result, $request ): bool {
    if ( \strpos( $request->get_route(), '/yoast/v1/schema-aggregator' ) !== 0 ) {
    return $served;
    }

    if ( ! $result instanceof WP_REST_Response || $result->is_error() ) {
    return $served;
    }

    $this->schema_map_header_adapter->set_header_for_request( $result );

    return true;
    }

    The function is expected to return a boolean, but $served can be null, which causes the fatal error when it is returned.

    As a temporary fix, we changed the return to:
    return $served ?? false;

    This resolves the issue on our side.

    Best regards,
    Miguel

Viewing 1 replies (of 1 total)
  • Hello,

    I am experiencing the same fatal error. Additionally, this issue prevents me from viewing the payment methods in the WooCommerce settings.

    Thank you for your help.

    Best regards,
    Alexis

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.