From a0865ad2a6fb1e8d095c90ec99bfac3f973af60b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lys=C3=BD?= Date: Thu, 7 Dec 2023 09:50:00 +0100 Subject: [PATCH] Use filter to avoid exception when WC orders are out of sync [MAILPOET-5759] --- mailpoet/tests/_support/woo_cot_helper_plugin.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mailpoet/tests/_support/woo_cot_helper_plugin.php b/mailpoet/tests/_support/woo_cot_helper_plugin.php index a98b048283..178d2a7125 100644 --- a/mailpoet/tests/_support/woo_cot_helper_plugin.php +++ b/mailpoet/tests/_support/woo_cot_helper_plugin.php @@ -48,3 +48,8 @@ function mailpoet_create_cot() { if (class_exists(WP_CLI::class)) { WP_CLI::add_command('create_cot', 'mailpoet_create_cot'); } + +// Related PR in WooCommerce: https://github.com/woocommerce/woocommerce/pull/39988 +// Sometimes during tests can happen that orders are out of sync. This state can trigger and exception +// The following filter avoids this state +add_filter('wc_allow_changing_orders_storage_while_sync_is_pending', '__return_true');