Make WordPress Core

Opened 4 weeks ago

Last modified 2 weeks ago

#45719 new defect (bug)

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

Reported by: pento Owned by:
Milestone: 5.1 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 (8)

#1 @pento
4 weeks ago

  • Description modified (diff)

#2 @pento
4 weeks 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
4 weeks ago

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

#4 @pento
4 weeks ago

#45723 was marked as a duplicate.

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

4 weeks ago

#6 @fierevere
4 weeks ago

WooCommerce fixed this issue in WC version 3.5.3

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

2 weeks ago

#8 @audrasjb
2 weeks 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.

Note: See TracTickets for help on using tickets.