First of all - thank you for making this module do automatic unsubscribe. THANK YOU! MAILCHIMP ROCKS!

I installed the 2.2 dev module on my site, and although the subscribe/unsubscribe functionality is working, I am getting this error when I complete a purchase using Ubercart. This happens regardless of if the product I am purchasing has a role associated with it (some of the products are paid subscriptions to an email newsletter which I am managing based on role). Here's the error:

user warning: Duplicate entry '23' for key 'PRIMARY' query: INSERT INTO mailchimp_user (uid, status) VALUES (23, 'pending') in [path of site]/modules/mailchimp/mailchimp.module on line 109.
user warning: Duplicate entry '23' for key 'PRIMARY' query: INSERT INTO mailchimp_user (uid, status) VALUES (23, 'pending') in [path of site]/modules/mailchimp/mailchimp.module on line 109.
user warning: Duplicate entry '23' for key 'PRIMARY' query: INSERT INTO mailchimp_user (uid, status) VALUES (23, 'pending') in [path of site]/modules/mailchimp/mailchimp.module on line 109.
user warning: Duplicate entry '23' for key 'PRIMARY' query: INSERT INTO mailchimp_user (uid, status) VALUES (23, 'pending') in [path of site]/modules/mailchimp/mailchimp.module on line 109.

i'm running version 6.x - 2.4 if that helps. Any ideas?

Comments

levelos’s picture

Status: Active » Closed (cannot reproduce)

Seems like hook_user with an operation of insert is being called several times during a UC checkout. No idea why this would be happening though. Might have to look to UC for a clue.

LPecunia’s picture

I am having a similar problem but it's not with Ubercart, it's with new user signups. I have assigned two MailChimp lists that I want users to be subscribed to. One is a required list and the other is Opt-Out.

Any time I add a user manually, OR a user signs up, this ugly error is presented:
user warning: Duplicate entry '178' for key 1 query: INSERT INTO mailchimp_user (uid, status) VALUES (178, 'pending') in /home/emx/public_html/sites/all/modules/mailchimp/mailchimp.module on line 113.
user warning: Duplicate entry '178' for key 1 query: INSERT INTO mailchimp_user (uid, status) VALUES (178, 'pending') in /home/emx/public_html/sites/all/modules/mailchimp/mailchimp.module on line 113.
user warning: Duplicate entry '178' for key 1 query: INSERT INTO mailchimp_user (uid, status) VALUES (178, 'pending') in /home/emx/public_html/sites/all/modules/mailchimp/mailchimp.module on line 113.

The message is repeated three times, every time.

I looked in the database and the highest uid at the time of insert was the id below this one (e.g. 177 in this case). The user table is populated and the mailchimp table is populated with "pending". The opt-out list is populated in Mailchimp but the required list is not. The API calls are also registering in MailChimp.

Sorry if this is the wrong place to put this. It's really driving me batty, I've tried everything to try to resolve this with no luck.

miss-susan’s picture

I ended up ignoring the errors and disabling error reporting to the screen. I can't seem to find any problems with the mailing list syncing. Super weird.

ColinMctavish’s picture

Hi miss-susan..How do you disable the error reporting?

ColinMctavish’s picture

sorry, figured it out.. thanks