-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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 #23870 - State field editing for orders in admin #24019
Conversation
Codecov Report
|
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.
Hi @harddy , thanks for the contribution, but could you please update the PR description with the complete PR template filled out as you were asked to do when opening the PR? This just helps us with seeing what you went through, testing instructions, a changelog and a clear description of what is changing.
https://github.com/woocommerce/woocommerce/blob/master/.github/PULL_REQUEST_TEMPLATE.md
Hello @kloon . Thanks for the feedback. I have updated the PR description. Please let me know if any more changes are required. |
@@ -39,10 +39,11 @@ jQuery( function ( $ ) { | |||
var $this = $( this ), | |||
country = $this.val(), | |||
$state = $this.parents( 'div.edit_address' ).find( ':input.js_field-state' ), | |||
$stateValue = $state.val(), |
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.
variable should not use dollar sign; vars prefixed with $ indicate jQuery objects
…ting addresses This code is an improvement to PR woocommerce#24019: https://github.com/woocommerce/woocommerce/pull/24019/files/622816f2dc6b8c6d41bc438efb3921c1880d8eb1 It differs in two ways: 1) This includes a fix for State select lists (for countries that employ them instead of a simple text input) 2) It modified the variable name added in woocommerce#24019 to omit the leading dollar sign, since the variable is not a jQuery object.
I'm not sure of the etiquette and protocol for suggesting an amendment to a PR someone else submitted. I left a comment on this PR regarding variable naming, but I also want to point out an additional fix for countries that employ lists of states. I've forked and committed changes here: |
This issue is causing the postmeta for this field to be deleted when orders are saved on the Edit Order screen. The issue only affects languages which have no predefined states in |
This does affect countries with predefined states. See my comment on the bug report: |
Fixed #23870
This PR will fix the state name issue.
Please review it and let me know if any changes are required.
Changes proposed in this Pull Request:
Closes #23870 .
How to test the changes in this Pull Request:
Other information:
Changelog entry