Skip to content
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

Undefined array key PHP warning #10228

Open
FangedParakeet opened this issue Jan 24, 2025 · 0 comments · May be fixed by #10229
Open

Undefined array key PHP warning #10228

FangedParakeet opened this issue Jan 24, 2025 · 0 comments · May be fixed by #10229
Assignees
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.

Comments

@FangedParakeet
Copy link
Contributor

Describe the bug

The following was spotted occurring regularly on Atomic sites.

PHP Warning:  Undefined array key "required" in /srv/htdocs/wp-content/plugins/woocommerce-payments/includes/class-wc-payments-checkout.php on line 249

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 a required property (see source here for reference) or one could simply add a custom field without any required validation.

Actual behavior

Code throws and logs a warning.

Screenshots

Atomic log
Atomic log

Expected behavior

Code should not throw any warnings.

@FangedParakeet FangedParakeet added focus: checkout payments priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: bug The issue is a confirmed bug. labels Jan 24, 2025
@FangedParakeet FangedParakeet self-assigned this Jan 24, 2025
@FangedParakeet FangedParakeet linked a pull request Jan 24, 2025 that will close this issue
6 tasks
@FangedParakeet FangedParakeet added the size: x-small This issue is sized less than a single story point. label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant