Fix bug when searching orders with a term starting with d, s, or f (#43085)
* Don't prepare the order search $meta_sub_query twice. Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Nestor Soriano <konamiman@konamiman.com>
This commit is contained in:
parent
187780905f
commit
e7647333a1
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: fix
|
||||||
|
|
||||||
|
Fix bug when searching orders with a term starting with d, s, or f.
|
|
@ -91,12 +91,9 @@ class OrdersTableSearchQuery {
|
||||||
$meta_sub_query = $this->generate_where_for_meta_table();
|
$meta_sub_query = $this->generate_where_for_meta_table();
|
||||||
|
|
||||||
$where .= $wpdb->prepare(
|
$where .= $wpdb->prepare(
|
||||||
"
|
'search_query_items.order_item_name LIKE %s',
|
||||||
search_query_items.order_item_name LIKE %s
|
|
||||||
OR `$order_table`.id IN ( $meta_sub_query )
|
|
||||||
",
|
|
||||||
'%' . $wpdb->esc_like( $this->search_term ) . '%'
|
'%' . $wpdb->esc_like( $this->search_term ) . '%'
|
||||||
);
|
) . " OR `$order_table`.id IN ( $meta_sub_query ) ";
|
||||||
|
|
||||||
return " ( $where ) ";
|
return " ( $where ) ";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue