-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Milestone
Description
Describe the bug
While testing #51 (see #51 (comment)) I ran into an issue in the following scenario:
- Either sign in with a new account or create a new account
- On the settings screen, verify no List is selected (should show
-- Select A List -- - Create a new page and add the Mailchimp block to it
- Verify the form shows correctly on the front-end
- Try and submit the form with no information or with valid information
- If debug is on, you should get the following PHP warning:
Undefined array key "field" in /mailchimp/lib/mailchimp/mailchimp.php on line 193
If I debug the response from the request, this is what I get:
{
["type"]=> string(54) "https://mailchimp.com/developer/marketing/docs/errors/"
["title"]=> string(18) "Resource Not Found"
["status"]=> int(404)
["detail"]=> string(42) "The requested resource could not be found."
["instance"]=> string(36) "redacted"
}
I think we can add better defensive programming here to ensure the value we want exists before we try and use it. But would also be ideal in this scenario to not allow the form at all if no valid list has been selected.
Steps to Reproduce
No response
Screenshots, screen recording, code snippet
No response
Environment information
No response
WordPress information
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
No labels