From 71346e880eb7026d5a800f2cccbb71f1dcac93a6 Mon Sep 17 00:00:00 2001 From: Dharmesh Patel Date: Mon, 3 Feb 2025 11:13:22 +0530 Subject: [PATCH] Fix the fatal error that occurs while processing a subscription renewal when the object is stored in the subscription's metadata. --- .../class-sv-wc-payment-gateway-integration-subscriptions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php b/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php index 105df9075..827efef02 100644 --- a/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php +++ b/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php @@ -448,7 +448,7 @@ public function do_not_copy_order_meta( $order_meta ) { foreach ( (array) $order_meta as $index => $meta ) { // this accounts for different versions of the Subscriptions filter running before and after WooCommerce Subscriptions 2.5 - if ( in_array( $index, $meta_keys ) || ( isset( $meta['meta_key'] ) && in_array( $meta['meta_key'], $meta_keys ) ) ) { + if ( in_array( $index, $meta_keys ) || ( is_array( $meta ) && isset( $meta['meta_key'] ) && in_array( $meta['meta_key'], $meta_keys ) ) ) { unset( $order_meta[ $index ] ); } }