Automattic / woocommerce-subscriptions-core

Subscriptions core package for WooCommerce
Other
80 stars 29 forks source link

Uncaught exception 'TypeError' with message 'WCS_Related_Order_Store_Cached_CPT::delete_relations #600

Closed manzurahammed closed 2 months ago

manzurahammed commented 2 months ago

Describe the bug

Found this fatal error in our store.

Uncaught exception 'TypeError' with message 'WCS_Related_Order_Store_Cached_CPT::delete_relations(): Argument #1 ($order) must be of type WC_Order, bool given, called in /var/www/wp-content/plugins/woocommerce-subscriptions/includes/switching/class-wc-subscriptions-switcher.php on line 791' in /var/www/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/data-stores/class-wcs-related-order-store-cached-cpt.php:189

Product impact

Woocommerce Subscriptions plugin

james-allan commented 2 months ago

[!note] WCS_Related_Order_Store_Cached_CPT::delete_relations() is only currently called in 1 place (code link) and it just passes the result of wc_get_order() so I think we will just need to be more defensive there.

mattallan commented 2 months ago

Closed by 4648-gh-woocommerce/woocommerce-subscriptions