Mailchimp throws a series of errors when Logintoboggan is installed and configured to allow new users to set their own passwords when creating accounts.

Steps to reproduce (on clean 7.14 install, with Mailchimp 7.x-2.5 and LoginToboggan 7.x-1.3):

1. Create two roles, one called ListMember, one called Unvalidated
2. Install mailchimp, configure a Required list, do not set it to sync on cron.
3. Configure list membership for the ListMember role
4. Install LoginToboggan. Enable the "Set Password" option and choose "unvalidated" for the non-authenticated role.
5. Create new account.
6. As admin, click the validation link or remove the user from the validation role.

The following errors are shown when the "You have successfully validated the user" message is shown:

Notice: Undefined index: original in mailchimp_lists_user_update() (line 308 of /home/storyhunter/drupal-7.14/sites/all/modules/mailchimp/modules/mailchimp_lists/mailchimp_lists.module).

Notice: Trying to get property of non-object in mailchimp_lists_user_update() (line 308 of /home/storyhunter/drupal-7.14/sites/all/modules/mailchimp/modules/mailchimp_lists/mailchimp_lists.module).

Notice: Undefined index: roles in mailchimp_lists_user_update() (line 308 of /home/storyhunter/drupal-7.14/sites/all/modules/mailchimp/modules/mailchimp_lists/mailchimp_lists.module).

Warning: array_diff_key(): Argument #1 is not an array in mailchimp_lists_user_update() (line 308 of /home/storyhunter/drupal-7.14/sites/all/modules/mailchimp/modules/mailchimp_lists/mailchimp_lists.module).

Debugging shows that the problem is the first parameter to mailchimp_lists_user_update. The function assumes the existence of $edit['original'], but in this instance there is no 'original' member in the array.

Beyond the display of the error message, the user is never subscribed to the list they were supposed to be subscribed to.

Comments

kvoltz’s picture

I am getting something very similar on my end:

Notice: Undefined index: roles in mailchimp_lists_user_update() (line 305 of /home1/kvoltzde/public_html/littlelifestory/sites/all/modules/mailchimp/modules/mailchimp_lists/mailchimp_lists.module).

Warning: array_diff_key() [function.array-diff-key]: Argument #2 is not an array in mailchimp_lists_user_update() (line 305 of /home1/kvoltzde/public_html/littlelifestory/sites/all/modules/mailchimp/modules/mailchimp_lists/mailchimp_lists.module).

Notice: Undefined index: roles in mailchimp_lists_user_update() (line 305 of /home1/kvoltzde/public_html/littlelifestory/sites/all/modules/mailchimp/modules/mailchimp_lists/mailchimp_lists.module).

Warning: array_diff_key() [function.array-diff-key]: Argument #2 is not an array in mailchimp_lists_user_update() (line 305 of /home1/kvoltzde/public_html/littlelifestory/sites/all/modules/mailchimp/modules/mailchimp_lists/mailchimp_lists.module).

rickmanelius’s picture

I'm getting this as well, but only after installing "remember me" module.

rickmanelius’s picture

BTW, mine is a separate issue, so I'll spin off a new ticket.

levelos’s picture

Status: Needs review » Active

Needs review implies a patch has been submitted.

levelos’s picture