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

Fix fatal error during install due Amazon Pay settings #3898

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

wjrosa
Copy link
Contributor

@wjrosa wjrosa commented Feb 14, 2025

Fixes #3899

Changes proposed in this Pull Request:

We have an issue when installing the extension, happening when registering the settings route. The Amazon Pay settings default parameters can be undefined, causing a fatal error:

An error of type E_ERROR was caused in line 102 of the file /nas/content/live/bankpolicies/wp-content/plugins/woocommerce-gateway-stripe/includes/admin/class-wc-rest-stripe-settings-controller.php. Error message: Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in /nas/content/live/bankpolicies/wp-content/plugins/woocommerce-gateway-stripe/includes/admin/class-wc-rest-stripe-settings-controller.php:102

This PR fixes that by adding fallbacks to empty arrays.

Testing instructions

Code review should be enough. Check if the tests are still passing.


  • Covered with tests (or have a good reason not to test in description ☝️)
  • Added changelog entry in both changelog.txt and readme.txt (or does not apply)
  • Tested on mobile (or does not apply)

Post merge

@wjrosa wjrosa self-assigned this Feb 14, 2025
@wjrosa wjrosa marked this pull request as ready for review February 14, 2025 19:34
@wjrosa wjrosa requested a review from diegocurbelo February 14, 2025 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fatal error when installing the extension due Amazon Pay settings in settings route registration
1 participant