Undefined array key PHP warning #10228
Labels
focus: checkout payments
priority: high
The issue/PR is high priority—it affects lots of customers substantially, but not critically.
size: x-small
This issue is sized less than a single story point.
type: bug
The issue is a confirmed bug.
Describe the bug
The following was spotted occurring regularly on Atomic sites.
This warning appears to occurs on this line, introduced by #9707, and will produce a warning when a WC checkout billing field does not have a
required
property.This warning appears to have been occuring live since the 8.6.0 release of the plugin and has been encountered in related WPORG forum posts, such as this one.
To Reproduce
The forum post above mentions that the error occurs in the shop and on product pages, but it should be triggerable from the checkout as well, when any billing field validations lack a
required
property. One way to encounter such a field is to ensure that a store's location is such that billing address fields (e.g. city, state, or postcode, etc.) are lacking arequired
property (see source here for reference) or one could simply add a custom field without anyrequired
validation.Actual behavior
Code throws and logs a warning.
Screenshots
Atomic log
Expected behavior
Code should not throw any warnings.
The text was updated successfully, but these errors were encountered: