-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Include taxes migration in the states migrator helper method #35967
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
Conversation
Test Results SummaryCommit SHA: 5b3f360
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. |
peterfabian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this works well.
Besides the PHPCS below, I think we need to fix also the version strings in class-wc-install
'7.2.0' => array(
'wc_update_720_adjust_new_zealand_states',
'wc_update_720_adjust_ukraine_states',
),
| private static function migrate_country_states_for_tax_rates( string $country_code, array $old_to_new_states_mapping ): void { | ||
| global $wpdb; | ||
|
|
||
| // phpcs:disable WordPress.DB.PreparedSQL.NotPrepared |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if you put the $wpdb->prepare() directly into the $wpdb->query(), the phpcs disabling won't be necessary.
It's probably true for some other ones above, but this is fairly simple to change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change it but in general I prefer to first generate the query in a separate variable and then run it, as the resulting code is cleaner than a nested query(prepare($sql)), even if it's at the expense of having to disable the check.
peterfabian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good to me now!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The failing e2e test is not related (p1671022234510819-slack-C03CPM3UXDJ), so approving after the PHPCS change again.
* Include taxes migration in the states migrator helper method (#35967) * Prep for cherry pick 35967 * Move 7.2.1 fixes to separate heading in readme.txt Co-authored-by: Néstor Soriano <[email protected]> Co-authored-by: WooCommerce Bot <[email protected]> Co-authored-by: Sam Seay <[email protected]>
All Submissions:
Changes proposed in this Pull Request:
#35669 introduced a helper method to migrate state codes in various places of the database (shipping locations, orders, store address) but one placed that was missing is the tax rates table. This pull request fixes that.
How to test the changes in this Pull Request:
Same testing instructions of #35669 but this time testing that the state codes in the tax rates (WooCommerce - Settings - Tax - Standard, Reduced and Zero taxes) are properly updated.
Other information:
pnpm --filter=<project> changelog add?FOR PR REVIEWER ONLY: