Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix orders list in the admin #22273

Merged
merged 2 commits into from
Dec 20, 2018
Merged

Fix orders list in the admin #22273

merged 2 commits into from
Dec 20, 2018

Conversation

rodrigoprimo
Copy link
Contributor

@rodrigoprimo rodrigoprimo commented Dec 20, 2018

Changes proposed in this Pull Request:

WP 5.0.2, which was released yesterday, sets $query_vars['post_status'] to an empty string instead of leaving it unset (https://core.trac.wordpress.org/ticket/45719 and https://core.trac.wordpress.org/changeset/44185). This change broke the WC orders list in the admin when listing orders of all post statuses as we were checking if $query_vars['post_status'] was not set to add all order statuses to this variable (includes/admin/list-tables/class-wc-admin-list-table-orders.php#L799).

To workaround this problem, this commit introduces a change that verifies if $query_vars['post_status'] is empty instead of verifying if it is not set.

This PR also includes a separate commit to fix PHPCS violations in the modified file. I won't cherry-pick this commit when preparing the WC 3.5.3 release.

Closes #22271.

How to test the changes in this Pull Request:

  1. Confirm that this change restores the orders list in the admin (see Wordpress Update 5.02 broke the orders tab #22271 for a description of the problem) when running WP 5.0.2
  2. Confirm that the orders list in the admin still works when running WP <= 5.0.1

Changelog entry

Fix orders list in the admin after a change introduced in WordPress 5.0.2

WP 5.0.2, which was released yesterday, sets `$query_vars['post_status']` to an empty string instead of leaving it unset (https://core.trac.wordpress.org/ticket/45719 and https://core.trac.wordpress.org/changeset/44185). This change broke the WC orders list in the admin when listing orders of all post statuses as we were checking if `$query_vars['post_status']` was not set to add all order statuses to this variable (https://github.com/woocommerce/woocommerce/blob/125eaaf241aabc9d8c1bd77503c3e04da6082419/includes/admin/list-tables/class-wc-admin-list-table-orders.php#L799).

To workaround this problem, this commit changes the check to verify if `$query_vars['post_status']` is empty instead of verifying if it is not set.
Copy link
Contributor

@tiagonoronha tiagonoronha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Orders are displayed again in the list with this PR.

@rrennick
Copy link
Contributor

LGTM - This worked for me.

Copy link
Contributor

@claudiosanches claudiosanches left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wordpress Update 5.02 broke the orders tab
5 participants