The mailchimp_update_member_process function in mailchimp.module does not include the $tags variable in its function declaration, neither does it do anything with $tags like the mailchimp_subscribe_process function does.
This breaks cron when processing mailchimp updates via cron, because the new $tags variable is set in the cron queue item args array but is missing from the mailchimp_update_member_process function declaration. You'll see in the dblog: Error: Unknown named parameter $tags in mailchimp_cron() (line 1423 of /code/web/modules/contrib/mailchimp/mailchimp.module).
Here's what I think the function should be, to match mailchimp_subscribe_process, adding $tags=NULL in the function declaration, and tag handling (copied from mailchimp_subscribe_process) at the end of the function.
function mailchimp_update_member_process($list_id, $email, $merge_vars, $interests, $format, $double_optin = FALSE, $gdpr_consent = FALSE, $tags = NULL) {
.....
if ($double_optin) {
$msg = $config->get('optin_check_email_msg');
if ($msg) {
\Drupal::messenger()->addStatus($msg, FALSE);
}
}
// Add or update member tags
if ($tags) {
$tags = explode(',', (string) $tags);
$tags = array_map('trim', $tags);
try {
$mcapi->addTagsMember($list_id, $tags, $email);
}
catch (ClientException $e) {
\Drupal::logger('mailchimp')->error('An error occurred while adding tags for this email({email}) to Mailchimp: {message}', [
'message' => $e->getMessage(),
'email' => $email,
]);
}
}
return $result;
}
Issue fork mailchimp-3343846
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
derekw commentedComment #3
derekw commentedComment #4
derekw commentedComment #6
derekw commentedComment #8
xenophyle commentedComment #10
xenophyle commented