Skip to content

Commit

Permalink
Merge pull request woocommerce#24385 from woocommerce/fix/24356
Browse files Browse the repository at this point in the history
Ensure WC_Product_Data_Store_CPT::is_existing_sku() return boolean
  • Loading branch information
rodrigoprimo authored Aug 21, 2019
2 parents 9914ac5 + 5a1615a commit c3262ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/data-stores/class-wc-product-data-store-cpt.php
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ public function is_existing_sku( $product_id, $sku ) {
global $wpdb;

// phpcs:ignore WordPress.VIP.DirectDatabaseQuery.DirectQuery
return $wpdb->get_var(
return (bool) $wpdb->get_var(
$wpdb->prepare(
"
SELECT posts.ID
Expand Down Expand Up @@ -1088,7 +1088,7 @@ public function find_matching_product_variation( $product, $match_attributes = a

$query .= ' AND postmeta.meta_key IN ( "' . implode( '","', array_map( 'esc_sql', $meta_attribute_names ) ) . '" )';

$query.=' ORDER BY posts.menu_order ASC, postmeta.post_id ASC;';
$query .= ' ORDER BY posts.menu_order ASC, postmeta.post_id ASC;';

$attributes = $wpdb->get_results( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared

Expand Down

0 comments on commit c3262ee

Please sign in to comment.