Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#45719 closed defect (bug) (wontfix)

Setting an empty post_status in wp_edit_posts_query() breaks WooCommerce list tables

Reported by: pento's profile pento Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.0.2
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description (last modified by pento)

[44185] sets the post_status to an empty string, rather than leaving it unset.

WooCommerce checks this query var using isset() rather than empty() on the Orders screen, which results in no orders showing in that list table.

WooCommerce reference.

Change History (9)

#1 @pento
5 years ago

  • Description modified (diff)

#2 @pento
5 years ago

Here's a workaround:

function fix_request_query_args_for_woocommerce( $query_args ) {
        if ( isset( $query_args['post_status'] ) && empty( $query_args['post_status'] ) ) {
                unset( $query_args['post_status'] );
        return $query_args;
add_filter( 'request', 'fix_request_query_args_for_woocommerce', 1, 1 );

#3 @TimothyBlynJacobs
5 years ago

Again, I think these empty strings should be replaced with null, which will work as expected with isset

#4 @pento
5 years ago

#45723 was marked as a duplicate.

This ticket was mentioned in Slack in #forums by yui. View the logs.

5 years ago

#6 @fierevere
5 years ago

WooCommerce fixed this issue in WC version 3.5.3

This ticket was mentioned in Slack in #core by audrasjb. View the logs.

5 years ago

#8 @audrasjb
5 years ago

  • Milestone changed from 5.0.3 to 5.1


Per today's bug scrub, let's address this ticket in the next major, 5.1, scheduled in February.

#9 @pento
5 years ago

  • Milestone 5.1 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

WooCommerce released a fix, and I haven't heard any other reports of issues, so I'm going to close this issue.

Note: See TracTickets for help on using tickets.