Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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?
Comment | File | Size | Author |
---|---|---|---|
#4 | mailchimp-settings-fixes-2925258-4-interdiff.txt | 607 bytes | Berdir |
#4 | mailchimp-settings-fixes-2925258-4.patch | 2.89 KB | Berdir |
Comments
Comment #2
BerdirThis 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.
Comment #3
BerdirAh, 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 :)
Comment #4
BerdirCopy paste fail, still had the same call below outside of the try/catch.
Comment #6
ruscoe CreditAttribution: ruscoe at ThinkShout for Mailchimp commented@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 :)
Comment #7
ruscoe CreditAttribution: ruscoe at ThinkShout for Mailchimp commented