Problem is likely the combination with customer_id, and whatever else \WC_Order_Data_Store_CPT::get_wp_query_args() might map into meta_query.
In #171 a new meta filter callback was introduced where it just clobbers any WP_Query converted meta with original $subscription_query_args['meta_query']
Describe the bug
After 4.7.0, one of our queries got busted:
Problem is likely the combination with
customer_id
, and whatever else\WC_Order_Data_Store_CPT::get_wp_query_args()
might map intometa_query
.In #171 a new meta filter callback was introduced where it just clobbers any
WP_Query
converted meta with original$subscription_query_args['meta_query']
https://github.com/Automattic/woocommerce-subscriptions-core/blob/5.1.0/includes/wcs-order-functions.php#L384-L399 with
`$query['meta_query'] = $meta;
To Reproduce
Run
wcs_get_subscriptions()
withcustomer_id
and ameta_query
.Expected behavior
Meta_query must not get clobbered.
Actual behavior
Meta_query is clobbered.
Product impact
Additional context
Seems to get fixed by
array_merge()
instead of assignment but is that correct?