Automattic / woocommerce-subscriptions-core

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

Use strtotime to avoid errors passing wc_datetime objects #619

Closed james-allan closed 1 month ago

james-allan commented 1 month ago

Description

Fixes the following warnings on the edit subscription page with HPOS disabled:

PHP Notice:  Object of class WC_DateTime could not be converted to int in /wcdev/app/public/wp-content/plugins/woocommerce-subscriptions-core/includes/wcs-time-functions.php on line 664

How to test this PR

  1. Disable HPOS
  2. Go to WooCommerce > Subscriptions
  3. Edit one of your subscriptions.
  4. Check your php error logs and verify you received the error mentioned above.
  5. On this branch there should be no error.

Product impact