• Resolved sbask

    (@sbask)


    When I upgrade from PHP 7 to any PHP 8 version I get this error on my extend membershp page — what can I do to fix this?

    2024/09/08 16:44:23 [error] 3857052#3857052: *10167736 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught TypeError: Unsupported operand types: string + int in /home/askwoody/public_html/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-payment-request.php:365 Stack trace: #0 /home/askwoody/public_html/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-payment-request.php(416): WC_Stripe_Payment_Request->get_product_price() #1 /home/askwoody/public_html/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-payment-request.php(808): WC_Stripe_Payment_Request->get_product_data() #2 /home/askwoody/public_html/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-payment-request.php(841): WC_Stripe_Payment_Request->javascript_params() #3 /home/askwoody/public_html/wp-includes/class-wp-hook.php(324): WC_Stripe_Payment_Request->scripts() #4 /home/askwoody/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #5 /" while reading response header from upstream, client: 98.36.39.15, server: askwoody.com, request: "GET /extend-subscription/ HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.1-fpm.askwoody.sock:", host: "www.askwoody.com", referrer: "https://www.askwoody.com/" 2024/09/08 16:45:08 [error] 3857052#3857052: *10167928 FastCGI sent in stderr: "PHP message: PHP Warning:  Attempt to read property "post_name" on null in /home/askwoody/public_html/wp-content/themes/newaskwoody/woocommerce/widgets.php on line 41" while reading response header from upstream, client: 24.173.73.100, server: askwoody.com, request: "GET /forums/topic/how-to-send-cash-to-website/&sa=U&ved=2ahUKEwiV4Pm2m7SIAxV8M9AFHce3OOgQFnoECAQQAg&usg=AOvVaw1F9SrmdgnRcW4YxpyyuPI2 HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.1-fpm.askwoody.sock:", host: "www.askwoody.com", referrer: "https://www.google.com/" 2024/09/08 16:45:12 [error] 3857052#3857052: *10167919 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught TypeError: Unsupported operand types: string + int in /home/askwoody/public_html/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-payment-request.php:365 Stack trace: #0 /home/askwoody/public_html/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-payment-request.php(416): WC_Stripe_Payment_Request->get_product_price() #1 /home/askwoody/public_html/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-payment-request.php(808): WC_Stripe_Payment_Request->get_product_data() #2 /home/askwoody/public_html/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-payment-request.php(841): WC_Stripe_Payment_Request->javascript_params() #3 /home/askwoody/public_html/wp-includes/class-wp-hook.php(324): WC_Stripe_Payment_Request->scripts() #4 /home/askwoody/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #5 /" while reading response header from upstream, client: 98.36.39.15, server: askwoody.com, request: "GET /extend-subscription/ HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.1-fpm.askwoody.sock:", host: "www.askwoody.com", referrer: "https://www.askwoody.com/"

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hi @sbask,

    Thank you for reaching out.

    It appears you’re encountering a TypeError after upgrading to PHP 8.

    This error is often due to the incompatibility of certain plugins or themes with the new PHP version.

    In your case, the error seems to originate from WooCommerce Stripe Gateway plugin. We recommend updating all your plugins and themes to their latest versions, as the updates are to ensure compatibility with the latest PHP versions.

    If the error persists, try disabling the WooCommerce Stripe Gateway plugin temporarily to see if that resolves the issue.

    Please remember to backup your site before making any changes.

    Let us know how it goes.

    Thread Starter sbask

    (@sbask)

    I did all of those. The error is in this part of the code, Can I get someone to fix this in the code so I don’t have to manually fix it every time?

    The issue was in the file: ‘/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-payment-request.php’ line 365, where I had to add (int) casting to both values:

    broken:

    $product_price = $product->get_price() + WC_Subscriptions_Product::get_sign_up_fee( $product );

    fixed:

    $product_price = (int)$product->get_price() + (int)WC_Subscriptions_Product::get_sign_up_fee( $product );

    Plugin Support omarfpg a11n

    (@omarfpg)

    Hi @sbask, thank you for the additional information.

    I can see this is a reported bug, so our developers are aware of it already and should provide a fix soon. At the time being, we can’t give you an estimate for when the team will look into or fix the issue, as bug reports are prioritized based on a few criteria. Please subscribe to the GitHub issue if you’d like to receive updates.

    You can follow the report here: https://github.com/woocommerce/woocommerce-gateway-stripe/issues/2966.

    Thanks!
    -OP

    Thread Starter sbask

    (@sbask)

    Idiots broke it again in the latest Stripe update.

    I had to edit line 370

    Folks I don’t mind updating… I DO mind it when you break stuff you fixed.

    $product_price = (int)$product->get_price() + (int)WC_Subscriptions_Product::get_sign_up_fee( $product );

    Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hi @sbask,

    I had to edit line 370

    Sorry to hear about this. I checked the report, and can still see that it is open, do you mind sharing a further solution on the GitHub issue so that our developers can take a closer look at it? You can find the GitHub report here.

    Thank you for your patience and understanding.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.