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

Show an error message and return early if no list is chosen #40

Merged
merged 5 commits into from
Jun 28, 2024

Conversation

dkotter
Copy link
Collaborator

@dkotter dkotter commented Jun 28, 2024

Description of the Change

As reported in #37 (comment), if someone tries to update a list without actually selecting a list, a fatal error occurs.

This PR fixes that by ensuring we have a valid value first and if not, return early and show an error message.

Partially closes #37

Error when choosing invalid list

How to test the Change

  1. Install and activate the plugin
  2. Go to the settings page and enter a valid API key
  3. Change the selected list to be the default, no list selected value
  4. Click the update button and ensure an error message shows but no fatals occur

Changelog Entry

Fixed - Properly handle the scenario where a non-valid list is updated.

Credits

Props @dkotter, @qasumitbagthariya

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@dkotter dkotter added this to the 1.6.0 milestone Jun 28, 2024
@dkotter dkotter self-assigned this Jun 28, 2024
@github-actions github-actions bot added the needs:code-review This requires code review. label Jun 28, 2024
@dkotter dkotter requested a review from nateconley June 28, 2024 16:06
@nateconley
Copy link
Collaborator

@dkotter I noticed a couple of things and pushed up new commits:

  1. The form action was never updated to the new top level menu page 8c0152f
  2. There were persistent error messages when the list form was not being posted 3619ac5

mailchimp.php Show resolved Hide resolved
views/setup_page.php Show resolved Hide resolved
@dkotter dkotter merged commit fb2b4b8 into develop Jun 28, 2024
3 checks passed
@jeffpaul jeffpaul deleted the fix/invalid-list branch July 1, 2024 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs:code-review This requires code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression Testing for 1.6.0
2 participants