As long as I've used this module it is fraught with bugs. To the best of my memory it has never worked reliably. I need to as is there any slight chance that one day the maintainers will actually take their users seriously and get this thing to a working stage? In the meantime it would be very well received if you put this half baked mess back into sandbox.

In the meantime if someone has even a remote idea of how to deal with the following two messages:
Notice: Undefined property: stdClass::$detail in .../sites/all/libraries/mailchimp/src/MailchimpCURLClient.php on line 98

Fatal error: Call to undefined method Mailchimp\MailchimpAPIException::getResponse() in .../sites/all/libraries/mailchimp/src/MailchimpLists.php on line 586
php 5.4
using mailchimp 7.x-4.7+3-dev
library version 1.0.5
We do not use composer

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jmarr created an issue. See original summary.

mshaver’s picture

Assigned: Unassigned » ruscoe
Status: Active » Closed (duplicate)

This is a very specific issue related to using cURL instead of Guzzle which composer installs. Since this issue is related to the PHP library, I'm closing this and opening an issue in the follow issue queue: https://github.com/thinkshout/mailchimp-api-php/issues/50. Until we get to fixing this, you should be able to change the following line in MailchimpLists.php:

`throw new MailchimpAPIException($e->getResponse()`

to this:

`throw new MailchimpAPIException($e->getMessage()`

jmarr’s picture

Status: Closed (duplicate) » Active
Issue tags: +An error occurred requesting memberinfo for xxx@xxx.com in list 111111etc.

So fixing one bug simply pops up another. The whole point of this module on our site is to allow signups. That hasn't worked in weeks and its costing us credibility and potential sales.

On macmarr.com/testsign we get this error when the form fails (as it always does)
An error occurred requesting memberinfo for xxx@xxx.com in list 111111etc. ""

ruscoe’s picture

@jmarr, I just submitted that form with the email "dan@ruscoe.org"

Did you get an error in your log for that one? MailChimp may be blocking a particular email address due to being subscribed / unsubscribed too frequently. I've had it happen during testing.

jmarr’s picture

Yes....
Notice: Undefined property: stdClass::$size in mailchimp_insert_drupal_form_tag() (line 1524 of macmarr.com/sites/all/modules/mailchimp/mailchimp.module).
followed by:
An error occurred requesting memberinfo for dan@ruscoe.org in list xxxxetc. "The requested resource could not be found."
followed by:
Notice: Undefined property: stdClass::$size in mailchimp_insert_drupal_form_tag() (line 1524 of macmarr.com/sites/all/modules/mailchimp/mailchimp.module).

ruscoe’s picture

@jmarr I was able to reproduce this locally and I have a new library release for you:

https://github.com/thinkshout/mailchimp-api-php/releases/tag/v1.0.6

That should solve the error when adding list members.

The other error from mailchimp_insert_drupal_form_tag() is fixed in the dev branch of the module. Are you comfortable using the latest code from git? If not, let me know and I'll put the fix into a patch for you.

Please let me know if the new library release and module updates don't completely fix the problems.

jmarr’s picture

Issue tags: -An error occurred requesting memberinfo for xxx@xxx.com in list 111111etc.

Thanks roscoe,
It's very encouraging to see you taking this so seriously. It restores my faith in the module.
I've never used git so a patch would be appreciated. I see the patch link in the repository. If it's simply a matter of copying it and naming the file xxx.patch I can do that.

On another matter: the activity module is broken. No campaigns after 2015 show in the user "mailchimp activity" tab. I believe you're trying to load them using the eepurl shortener but mailchimp discontinued a while ago:
Notice: Undefined index: aa2f654ac5 in macmarr.com/sites/all/modules/mailchimp/modules/mailchimp_activity/mailchimp_activity.module on line 230

Notice: Trying to get property of non-object in macmarr.com/sites/all/modules/mailchimp/modules/mailchimp_activity/mailchimp_activity.module on line 230

jmarr’s picture

Issue tags: +Mailchimp\MailchimpAPIException: The requested resource could not be found. in Mailchimp\Mailchimp->handleRequestCURL() (line 362 of macmarr.com/sites/all/libraries/mailchimp/src/Mailchimp.php).

One more error. When trying to view a campaign it cannot be found.
To duplicate:
Create campaign...no template..enter anything in html box
Save as draft
Try to reopen with "view" or title link.
config/services/mailchimp/campaigns works
config/services/mailchimp/campaigns/(campaign number) produces the error

library 1.0.6

jmarr’s picture

Issue tags: -Mailchimp\MailchimpAPIException: The requested resource could not be found. in Mailchimp\Mailchimp->handleRequestCURL() (line 362 of macmarr.com/sites/all/libraries/mailchimp/src/Mailchimp.php).

@roscoe I was able to create a patch file from #6 and apply it. That fixed the error - thanks very much.
Two issues though
- the phone field is now too long - not critical but its ugly.
- when the form data is submitted to Mailchimp the phone field shows as (1111111111) instead of (111)111-1111). This is a problem.

ruscoe’s picture

Thanks for confirming that original fix and reporting the remaining issues. I'm going to be working on these today. Just to confirm, this is what I have:

- Campaigns are not appearing on the MailChimp Activity tab
- Phone number field length is not being limited
- Phone number is formatted incorrectly when sent to MailChimp
- Individual campaigns cannot be viewed

Glad you could get the module fixed added as a patch. You're right that you just needed to take this latest commit and put it into a patch file. I'm going to put additional changes related to this issue into patch files to make it easier.

jmarr’s picture

Details on your questions:
- Campaigns are not appearing on the MailChimp Activity tab
Are campaigns supposed to show in this tab?
I have one activity entity - see screenshot. This tab seems to be fine. It produces no errors.

The problem is with a user's page. Activity for recent lists have no Campaign - see screenshot.
There are also multiple notices referencing line 230 and 231 of mailchimp_activity module such as:
Notice: Undefined index: 675d(etc) in macmarr.com/sites/all/modules/mailchimp/modules/mailchimp_activity/mailchimp_activity.module on line 230

We modified this list last year on the Mailchimp site - merging users to a new list with the same name so perhaps the Drupal module has the correct list name but is using an out of date id???

- Phone number field length is not being limited
Correct

- Phone number is formatted incorrectly when sent to MailChimp
Correct - I entered my phone number both as a 10 digit string and a formatted (514)833-8352. In both cases mailchimp dumped the whole thing into the NA area code - 5148338352 is translated by mailchimp to (5148338352)___-_____ or ((514)8338352)

- Individual campaigns cannot be viewed
Correct. Campaigns created in Mailchimp dont'e appear but campaigns created in the Campaigns tab are saved properly (an entry is created in the DB table and the campaign shows in mailchimp) but trying to click on the title or the "view" link creates :
Mailchimp\MailchimpAPIException: The requested resource could not be found. in Mailchimp\Mailchimp->handleRequestCURL() (line 362 of macmarr.com/sites/all/libraries/mailchimp/src/Mailchimp.php)

One other bug in the signup form....no confirmation message shows upon submit. Redirecting to another page works though.

Hope all of this helps

ruscoe’s picture

Just adding a quick update here to let you know I'm still working on this. Patches are coming shortly.

ruscoe’s picture

This patch fixes the length of the phone number field and the incorrect phone number format when sent to MailChimp.

jmarr’s picture

He Roscoe, the phone field patch seems to work perfectly. Thanks.

ruscoe’s picture

Attached patch fixes the unviewable campaign issue.

Campaigns created in MailChimp don't sync to Drupal by design (it's one-way), but I'd be happy to add that to our feature request list if it would be helpful.

Campaign names should appear next to activity on the activity tab. I'm looking into that one next.

ruscoe’s picture

One more patch to fix the missing campaign names and errors on the activity tab.

I think that should be everything. Please let me know if not.

ruscoe’s picture

I've also committed all the included patches to the 7.x-4.x dev branch.

jmarr’s picture

Status: Active » Fixed

Both campaign patches fix the problem on our site. Thanks.
I don't see any need to sync campaigns created on Mailchimp but perhaps I'm not up to speed on what that would add.

jojik’s picture

So when will there be a stable 4.8 version of the module?

ruscoe’s picture

We'll have a new release out early next week. There are a few other big issues in the queue that we'd like to get fixed and into that release as well.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.