Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type checking #516

Open
1 task
WillBrubaker opened this issue Sep 28, 2023 · 0 comments
Open
1 task

Type checking #516

WillBrubaker opened this issue Sep 28, 2023 · 0 comments
Labels
type: bug The issue is a confirmed bug.

Comments

@WillBrubaker
Copy link

Describe the bug

A cart session can end up in a state where line_item_id no longer exists. This results in a PHP fatal error (or warning depending on PHP version)

To Reproduce

  1. Have a renewal in the cart
  2. Maybe logout. Something happens to the session data such that line_item_id is removed ¯_(ツ)_/¯
  3. Presumably log back in and continue on with trying to complete checkout with the renewal
  4. Depending on PHP version:
[25-Sep-2023 13:16:58 UTC] PHP Notice:  Undefined offset: 7777777 in /apps/no-pong/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/class-wcs-cart-renewal.php on line 433
[25-Sep-2023 13:16:58 UTC] PHP Notice:  Trying to access array offset on value of type null in /apps/no-pong/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/class-wcs-cart-renewal.php on line 435
[25-Sep-2023 13:16:58 UTC] PHP Notice:  Trying to access array offset on value of type null in /apps/no-pong/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/class-wcs-cart-renewal.php on line 450
[25-Sep-2023 13:16:58 UTC] PHP Notice:  Trying to access array offset on value of type null in /apps/no-pong/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/class-wcs-cart-renewal.php on line 450
[25-Sep-2023 13:16:58 UTC] PHP Warning:  array_sum() expects parameter 1 to be array, null given in /apps/no-pong/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/class-wcs-cart-renewal.php on line 450

Or a fatal error for similar.

Expected behavior

A WooCommerce notice or something less brutal than a fatal error.

Actual behavior

Product impact

  • [x ] Does this issue affect WooCommerce Subscriptions? yes/no/tbc, add issue ref
  • Does this issue affect WooCommerce Payments? yes/no/tbc, add issue ref

Additional context

7072656-zen

@WillBrubaker WillBrubaker added the type: bug The issue is a confirmed bug. label Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug The issue is a confirmed bug.
Projects
None yet
Development

No branches or pull requests

1 participant