I can't quite figure out why this is happening but this is the scenario: Using migrate module to import users from a D6 SQL db to the current D7 site I find that mailchimp_lists_user_sync is triggered for each user and they are added to the list in . There is no required lists though and the users should not be added by default.

Can you give me some hints as to why this is happening and where I might look to resolve it? Is there something I can add to the user object before it's saved to tell the Mailchimp module not to add it to a list?

From what I can tell its due to this statement returning false:
if (!empty($old_email) && mailchimp_is_subscribed($list->mc_list_id, $old_email))
$old_email has an empty value so mailchimp_is_subscribed is not firing and it moves onto the else:
mailchimp_subscribe_user($list, $account->mail, $mergevars, FALSE, $mcapi);
I think this behaviour is incorrect but I'm not sure how to fix it.

Panning back a bit I'm not even sure why the code is at this stage. There aren't any required lists so surely mailchimp_lists_user_sync shouldn't be firing at all?

Comments

gcb’s picture

Status: Active » Closed (fixed)

mailchimp_lists_user_sync fires on all user creation and checks for required lists. This is a bug but its reported elsewhere, and has been resolved in the development tree. Look for 7.x-2.11 shortly and this issue should be gone.