Steps to reproduce:

1. Enable the following: mailchimp, mailchimp_lists and mailchimp_signup and rebuild cache
2. Configure API key via /admin/config/services/mailchimp and sync lists
3. Create a signup form via /admin/config/services/mailchimp/signup and configure form to use one or more of available lists
4. Either delete one of the lists used above on the Mailchimp side or change Mailchimp account / API key via /admin/config/services/mailchimp
5. Go to /admin/config/services/mailchimp/lists and refresh lists
6. Go back to configuring signup forms /admin/config/services/mailchimp/signup

Expected behavior:

I should be able to edit and configure signup forms to use different list(s)

Actual behavior:

WSOD:

The website encountered an unexpected error. Please try again later.

InvalidArgumentException: $string ("") must be a string. in Drupal\Core\StringTranslation\TranslatableMarkup->__construct() (line 140 of core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php).
...
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

spesic created an issue. See original summary.

spesic’s picture

Status: Active » Needs review
MaskOta’s picture

The patch helped with the WSOD problem for me.

Keep in mind that you still need to re-add the mailchimp list to the signup form.

spesic’s picture

#4 This is correct. We should probably add some form of messaging as well when this scenario is met. I'm not sure what would be the best approach here.
Adding a notice on mailchimp signup admin page should probably suffice, but maybe a global notice would be appropriate as well. Any thoughts?

asrob’s picture

Status: Needs review » Reviewed & tested by the community

I've successfully applied this patch and looks good to me. RTBC'ed!

Greg Boggs’s picture

Did you also test the module by deleting an active list after applying the patch?

asrob’s picture

@Greg Boggs,

Yes, I did the steps to reproduce this issue. I can edit signup page after deleting the list, however I can only see "Email address" below the merge field display section. See my attached picture. I didn't encounter that error spesic said / reported.

Greg Boggs’s picture

Sorry spesic, this one got fixed with another commit. So, I can't get you commit credit for the patch, but thank you!

Greg Boggs’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.