-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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] Additional field extensible sanitisation and validation handling #44463
Merged
senadir
merged 21 commits into
trunk
from
update/account-additional-fields-validaiton-44019
Feb 13, 2024
Merged
Changes from 17 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
5a354a4
Fix field saving in account area
mikejolley 5953436
Check for error notices in core form handler
mikejolley 872c8f4
Tidy up additional field saving in api
mikejolley bf00dcc
sanitize_additional_fields does not expect request
mikejolley 6f1c86d
Validate fields with extra context
mikejolley 59349f7
Revert "Tidy up additional field saving in api"
mikejolley 844149a
Tidy update_customer_from_request
mikejolley c5515f2
validate_field docs
mikejolley 639b5cf
Validation and sanitization hooks
mikejolley 5db6a33
Address schema validates fields and address location
mikejolley 3aaa6f2
Validate locations
mikejolley 28b4e64
Frontend validation
mikejolley a19198f
Remove empty error response
mikejolley 9184a5e
Document account details hook
mikejolley c84823e
field_key
mikejolley e59eb4c
Improve validation routine
mikejolley a11a4c9
Changelog
mikejolley d98b492
Swap key and value in woocommerce_blocks_validate_additional_field hook
mikejolley b424149
woocommerce_blocks_validate_location_X_fields
mikejolley df504d9
Validation and sanitization callbacks
mikejolley 94d2f73
Update try catch blocks
mikejolley File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
plugins/woocommerce/changelog/update-account-additional-fields-validaiton-44019
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: update | ||
|
||
This is behind a feature flag. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
When the
additional
area is validated, the hook is:woocommerce_blocks_validate_additional_fields
which may be easily confused withwoocommerce_blocks_validate_additional_field
. Do you think this is an issue? Should we consider renaming one or the other? Maybe addinglocation
to the location hook would work?woocommerce_blocks_validate_location_additional_fields
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.
Added in b424149