The website encountered an unexpected error. Please try again later.
Error: Call to undefined function Drupal\mailchimp\Form\l() in Drupal\mailchimp\Form\MailchimpAdminSettingsForm->buildForm() (line 100 of modules/contrib/mailchimp/src/Form/MailchimpAdminSettingsForm.php).

Looks like an incomplete port of a new 7.x-1.x feature?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir created an issue. See original summary.

Berdir’s picture

This patch fixes that and also a missing toString() on the other URL. I also changed the strings to include the into the translatable text, that's the recommended practice for such examples as it allows translators to translate the whole sentence, including the part inside the link tags in context.

And I used $this->t() on the touched lines. I also added a fix to prevent it from failing with "Error: Call to a member function getConnectedSites() " if there is no API key yet.

Berdir’s picture

Ah, one more problem, if you manage to enter an invalid API key, then the page also dies with an exception. "Interesting" that no API returns NULL and a wrong one throws an exception :)

Berdir’s picture

  • ruscoe committed f3120c1 on 8.x-1.x authored by Berdir
    Issue #2925258 by Berdir: Fatal error on admin/config/services/mailchimp...
ruscoe’s picture

@Berdir That works perfectly, thank you. We really appreciate the patches.

I do need to take a look at how we're loading the API and make sure its throwing exceptions for any errors. Returning NULL sometimes is a bit weird and leads to problems like this :)

ruscoe’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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