diff --git a/plugins/woocommerce/changelog/fix-34677 b/plugins/woocommerce/changelog/fix-34677 new file mode 100644 index 00000000000..8d54ce0298c --- /dev/null +++ b/plugins/woocommerce/changelog/fix-34677 @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Do no override order defaults with NULL values (HPOS) diff --git a/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php b/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php index 8fa8a94fe0f..dae05bd5893 100644 --- a/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php +++ b/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php @@ -836,6 +836,9 @@ SELECT type FROM {$this->get_orders_table_name()} WHERE id = %d; } $prop_value = $order_data->{$prop_details['name']}; + if ( is_null( $prop_value ) ) { + continue; + } if ( 'date' === $prop_details['type'] ) { $prop_value = $this->string_to_timestamp( $prop_value );