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
[Experiment] Fix additional address field validation notices #44615
Conversation
Hi @opr, @tarunvijwani, Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
Test Results SummaryCommit SHA: 454ae46
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. |
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.
Just need a change to the condition for the empty value currently it's not working
Significance: patch | ||
Type: update | ||
|
||
This is behind a feature flag. |
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 believe this should be Comment: This is behind a feature flag.
to prevent being added to the actual changelog
@@ -469,6 +462,20 @@ private function process_select_field( $field_data, $options ) { | |||
} | |||
|
|||
$field_data['options'] = $cleaned_options; | |||
|
|||
// If the field is not required, inject an empty option at the start. | |||
if ( isset( $options['required'] ) && false === $options['required'] && ! in_array( '', $added_values, true ) ) { |
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.
We need to get $field_data['required']
instead here, $options doesn't contain required
8bf1617
to
454ae46
Compare
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.
Working for me!
Submission Review Guidelines:
Changes proposed in this Pull Request:
Fixes 2 issues with additional fields blocking checkout with notices:
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
Test snippet:
This requires doc updates @opr
Changelog entry
Significance
Type
Message
Comment