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

Fatal error can occur in subscription-totals-table.php #750

Open
nicdwilson opened this issue Dec 16, 2024 · 0 comments
Open

Fatal error can occur in subscription-totals-table.php #750

nicdwilson opened this issue Dec 16, 2024 · 0 comments
Labels
type: bug The issue is a confirmed bug.

Comments

@nicdwilson
Copy link

Describe the bug

In subscription-totals-table.php we create a product object here

The is filtered by woocommerce_subscriptions_order_item_product, and we check the status of the object before using it here

However, it is subsequently used without a check here

On rare occasions, where the value has been filtered, such as in 9093977-zd-a8c, this can result in a fatal error.

Uncaught Error: Call to a member function get_purchase_note() on bool in /www/[redacted]/public/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/templates/myaccount/subscription-totals-table.php:79  

To Reproduce

  1. Return false on woocommerce_subscriptions_order_item_product
  2. Check the view subscription page in My Account

Actual behavior

Improper use of the filter can have unexpected results.

Product impact

  • [ yes] Does this issue affect WooCommerce Subscriptions? yes/no/tbc, add issue ref
  • [ no] Does this issue affect WooCommerce Payments? yes/no/tbc, add issue ref
@nicdwilson nicdwilson added the type: bug The issue is a confirmed bug. label Dec 16, 2024
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