Skip to content
Snippets Groups Projects

Issue #3480035 by mlncn: After upgrading to Mailchimp 2.2.5, failure to get...

+ 3
2
@@ -111,11 +111,12 @@ function mailchimp_get_list($list_id) {
*/
function mailchimp_get_lists(array $list_ids = [], $reset = FALSE) {
$collection = \Drupal::keyValue('mailchimp_lists');
$lists = $reset ? NULL : $collection->get('lists');
/** @var array<string, mixed> */
$lists = $reset ? [] : $collection->get('lists');
// If we have no stored lists, or we are forcing a refresh, get them from
// Mailchimp.
if (empty($lists)) {
if ($lists === []) {
try {
/** @var \Mailchimp\MailchimpLists $mcapi */
$mcapi = mailchimp_get_api_object('MailchimpLists');
@@ -161,7+162,7 @@
}
}
catch (\Exception $e) {
\Drupal::logger('mailchimp')->error('An error occurred requesting list information from Mailchimp. "{message}"', [
'message' => $e->getMessage(),
]);
}
Loading