You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.
Describe the bug
An error is thrown when wc_get_orders is called with a custom query parameter which uses the woocommerce_order_data_store_cpt_get_orders_query filter to define additional meta_query` items.
WordPress database error Unknown column 'wptests_postmeta.meta_key' in 'where clause' for query SELECT wptests_posts.ID FROM wptests_posts LEFT JOIN wptests_woocommerce_orders ON ( wptests_posts.ID = wptests_woocommerce_orders.order_id ) WHERE 1=1 AND (
( wptests_postmeta.meta_key = '_custom_meta_key' AND wptests_postmeta.meta_value = 'value' )
) AND wptests_posts.post_type IN ('shop_order', 'shop_order_refund') AND ((wptests_posts.post_status = 'wc-pending' OR wptests_posts.post_status = 'wc-processing' OR wptests_posts.post_status = 'wc-on-hold' OR wptests_posts.post_status = 'wc-completed' OR wptests_posts.post_status = 'wc-cancelled' OR wptests_posts.post_status = 'wc-refunded' OR wptests_posts.post_status = 'wc-failed')) GROUP BY wptests_posts.ID ORDER BY wptests_posts.post_date DESC LIMIT 0, 10
Expected behavior $orders returns as an array with the expected order.
Describe the bug
An error is thrown when
wc_get_orders
is called with a custom query parameter which uses thewoocommerce_order_data_store_cpt_get_orders_query filter to define additional
meta_query` items.To Reproduce
Steps to reproduce the behavior:
wc_get_orders
with the custom query var.Expected behavior
$orders
returns as an array with the expected order.Versions
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: