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: Uncaught Error: Call to a member function get_items() on false in includes\class-wcs-download-handler.php:70 #638

Open
2 tasks done
norud opened this issue Jul 11, 2024 · 0 comments
Labels
type: bug The issue is a confirmed bug.

Comments

@norud
Copy link

norud commented Jul 11, 2024

Describe the bug

I get that error developing a payment plugin that supports subscriptions.

$subscriptions = wcs_get_subscriptions_for_order( $order );
var_dump($subscriptions) -> array(1) { [369]=> bool(false) }

To Reproduce

the error i get see start from
$order->set_status($wc_order_status);
$order->save();

when the order have subscriptions, the error happens on file
\wp-content\plugins\woocommerce-subscriptions\vendor\woocommerce\subscriptions-core\includes\class-wcs-download-handler.php on line 70

on line 63 wcs_order_contains_subscription( $order, 'any' )  which is true ang call
$subscriptions = wcs_get_subscriptions_for_order( $order, array( 'order_type' => array( 'any' ) ) );

where not get subscription object

Expected behavior

get subscription object no array with bool

Actual behavior

$subscriptions = wcs_get_subscriptions_for_order( $order );
var_dump($subscriptions);
array(1) { [369]=> bool(false) }

Product impact

  • 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

plugin details:
WooCommerce Subscriptions Version 6.4.1
WooCommerce Version 9.0.2

@norud norud added the type: bug The issue is a confirmed bug. label Jul 11, 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