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

Use correct datastore when backfilling orders. #35176

Merged
merged 2 commits into from Oct 20, 2022
Merged

Conversation

vedanshujain
Copy link
Contributor

All Submissions:

Changes proposed in this Pull Request:

When backfilling refunds, we were using WC_Order object and WC_Order_Data_Store_CPT object to backfill, which was causing errors when the object type is anything order WC_Order. This PR fixes the issue by loading the correct datastore and object type as needed (and not making any assumptions)

  • This PR is a very minor change/addition and does not require testing instructions (if checked you can ignore/remove the next section).

How to test the changes in this Pull Request:

  1. With sync enabled and COT as authoritative, refund an order.
  2. Without this PR you will see an error.
  3. With this PR, order refund will be created successfully, and can be verified in the post table as well.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you created a changelog file for each project being changed, ie pnpm changelog add --filter=<project>?

FOR PR REVIEWER ONLY:

  • I have reviewed that everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities. I made sure Linting is not ignored or disabled.

@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Oct 19, 2022
@vedanshujain vedanshujain requested review from a team and Konamiman and removed request for a team October 19, 2022 10:59
@github-actions
Copy link
Contributor

github-actions bot commented Oct 19, 2022

Test Results Summary

Commit SHA: c231598

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests19600201980m 42s
E2E Tests186003018915m 27s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

@vedanshujain vedanshujain merged commit 80cbb9d into trunk Oct 20, 2022
@vedanshujain vedanshujain deleted the fix/refunds_backfill branch October 20, 2022 07:52
@github-actions github-actions bot added this to the 7.2.0 milestone Oct 20, 2022
@github-actions
Copy link
Contributor

Hi @vedanshujain, thanks for merging this pull request. Please take a look at these follow-up tasks you may need to perform:

  • Add the release: add testing instructions label

@jonathansadowski jonathansadowski modified the milestones: 7.2.0, 7.1.0 Oct 20, 2022
github-actions bot pushed a commit that referenced this pull request Oct 20, 2022
* Use correct datastore when backfilling orders.

* Fix some unit tests and simplify calls.
jonathansadowski pushed a commit that referenced this pull request Oct 20, 2022
* Use correct datastore when backfilling orders. (#35176)

* Use correct datastore when backfilling orders.

* Fix some unit tests and simplify calls.

* Prep for cherry pick 35176

Co-authored-by: Vedanshu Jain <vedanshu.jain.2012@gmail.com>
Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: woocommerce Issues related to the WooCommerce Core plugin.
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants