WordPress.org

Make WordPress Core

Opened 6 months ago

Closed 5 months ago

#45719 closed defect (bug) (wontfix)

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

Reported by: 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
6 months ago

  • Description modified (diff)

#2 @pento
6 months 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
6 months ago

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

#4 @pento
6 months ago

#45723 was marked as a duplicate.

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


6 months ago

#6 @fierevere
6 months ago

WooCommerce fixed this issue in WC version 3.5.3

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


6 months ago

#8 @audrasjb
6 months ago

  • Milestone changed from 5.0.3 to 5.1

Hi,

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

#9 @pento
5 months 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.