From b3e011aa2bb3a3d6f3ddc5a9ed2abceda1c56d77 Mon Sep 17 00:00:00 2001 From: Vedanshu Jain Date: Tue, 8 Aug 2023 22:14:29 +0530 Subject: [PATCH] Rollback condition from delete flow as causes issues with no HPOS tables. --- plugins/woocommerce/changelog/fix-delete_db_issue | 5 +++++ .../src/Internal/DataStores/Orders/DataSynchronizer.php | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 plugins/woocommerce/changelog/fix-delete_db_issue diff --git a/plugins/woocommerce/changelog/fix-delete_db_issue b/plugins/woocommerce/changelog/fix-delete_db_issue new file mode 100644 index 00000000000..8e6d1a371c6 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-delete_db_issue @@ -0,0 +1,5 @@ +Significance: patch +Type: fix +Comment: Partial rollback of an earlier PR. + + diff --git a/plugins/woocommerce/src/Internal/DataStores/Orders/DataSynchronizer.php b/plugins/woocommerce/src/Internal/DataStores/Orders/DataSynchronizer.php index 770d232dfeb..c559b251703 100644 --- a/plugins/woocommerce/src/Internal/DataStores/Orders/DataSynchronizer.php +++ b/plugins/woocommerce/src/Internal/DataStores/Orders/DataSynchronizer.php @@ -667,10 +667,12 @@ ORDER BY orders.id ASC return; } + if ( ! $this->get_table_exists() ) { + return; + } + if ( $this->data_sync_is_enabled() ) { - if ( $this->get_table_exists() ) { - $this->data_store->delete_order_data_from_custom_order_tables( $postid ); - } + $this->data_store->delete_order_data_from_custom_order_tables( $postid ); } elseif ( $this->custom_orders_table_is_authoritative() ) { return; }