Skip to content

Conversation

@kevinruscoe
Copy link
Contributor

@kevinruscoe kevinruscoe commented Dec 30, 2020

All Submissions:

Changes proposed in this Pull Request:

As per #28652, WP5.6 defaults all restored post to the "draft" status. They have provided a filter to override this, and saves the previous status to the DB. This ensure restored orders and products are correctly put back to their previous status.

Closes #28652 .

How to test the changes in this Pull Request:

  1. Create a simple product
  2. Create an order
  3. Make order as complete
  4. Trash order
  5. Restore order, it should be complete (not draft).

Also:

  1. Create a product
  2. Publish it
  3. Trash it
  4. Restore it
  5. It should now be published, instead of draft.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully run tests with your changes locally?

Changelog entry

Ensure the orders and products statuses are reverted correctly when restoring them.

@kevinruscoe
Copy link
Contributor Author

Tests fail, but I think it's because I branched from master. Should I have branched from stable (4.8?)

@renatho
Copy link

renatho commented Jan 4, 2021

The code looks good to me and the issue is fixed for the orders. =)

@roykho
Copy link
Contributor

roykho commented Jan 7, 2021

Hi @kevinruscoe - could you please also make this work for products as well?

@kevinruscoe
Copy link
Contributor Author

@roykho All done. The post type 'product' is now included in the list of post types that should revert their status correctly when being restored.

Copy link
Contributor

@roykho roykho left a comment

Choose a reason for hiding this comment

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

Left a small comment but otherwise looks good.

Copy link
Contributor

@roykho roykho left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the PR!

@roykho roykho merged commit 0d2f478 into woocommerce:master Jan 13, 2021
@woocommercebot woocommercebot added release: add changelog Mark all PRs that have not had their changelog entries added. [auto] release: add testing instructions PRs that have not had testing instructions added to the wiki. [auto] labels Jan 13, 2021
@claudiosanches claudiosanches added this to the 5.0.0 milestone Jan 13, 2021
@claudiosanches claudiosanches added release: add testing instructions PRs that have not had testing instructions added to the wiki. [auto] and removed release: add testing instructions PRs that have not had testing instructions added to the wiki. [auto] labels Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: add changelog Mark all PRs that have not had their changelog entries added. [auto]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Order status is draft when restoring it from trash in WP 5.6

5 participants