Where do i download the MCAPI class? And when i download it where do i copy it to? my libraries directory?

CommentFileSizeAuthor
#9 mcapi_not_found-1950408-9.patch867 bytes__cj
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chrisjlee’s picture

Status: Active » Fixed

Found it in README.txt:

## Installation Notes
* You need to have a MailChimp API Key.
* You need to have at least one list created in MailChimp to use the
mailchimp_list module.
* For versions 7.x-2.8 and greater, the MCAPI library must be downloaded into
your libraries folder. It's available at http://apidocs.mailchimp.com/api/downloads/mailchimp-api-class.zip
or by using the included example drush make file. Proper libraries structure:
- libraries
- mailchimp
- MCAPI.class.php
- README

gcb’s picture

Status: Fixed » Closed (fixed)
gaele’s picture

Title: Fatal Error: Fatal error: Class 'MCAPI' not found in /home/xxxx/workspace/xx/sites/all/modules/mailchimp/includes/mailchimp » Fatal error: MCAPI not found
Version: 7.x-2.9 » 7.x-2.x-dev
Category: support » bug
Status: Closed (fixed) » Active

No matter what, a fatal error should never occur. When I install mailchimp and go to Campaigns without installing the MCAPI I get a white screen. I would expect a bit or error handling and a message telling me what's missing and what to do.

levelos’s picture

Status: Active » Closed (fixed)

@gaele, respectfully, there are plenty of situations where a fatal error will occur that a module cannot, and should not, account for. E.g., not meeting the module requirements or following the installation directions, which do tell you what to do.

chrisjlee’s picture

There could be a more direct link to the installation instructions. That would be more helpful. Just a suggestion. Unless, i'm missing something.

The documentation link on the project page links to a community docs but that page doesn't have any installation instructions.

gaele’s picture

there are plenty of situations where a fatal error will occur that a module cannot, and should not, account for.

Well, it could, but we differ on whether it should. Such a fatal error makes me wonder how robust the module is and what else I can expect.

I'd suggest adding a heading "Dependencies" mentioning MCAPI to the project page, perhaps with a link to the README.

gaele’s picture

Component: General » Documentation
Category: bug » task
Status: Closed (fixed) » Active
levelos’s picture

Status: Active » Closed (works as designed)

@gaele, thanks for the suggestion, the project page already makes the dependency clear. We'll continue to improve the project page and docs over time. There is not open issue, so please stop reopening it.

__cj’s picture

Status: Closed (works as designed) » Needs review
FileSize
867 bytes

This caught me out too.

The attached patch stops the fatal error (by returning null), and puts in a watchdog error, and displays a message on the screen.

(Hi levelos - apologies for reopening, I hope my small contribution excuses this behaviour, and I promise not to reopen if you close it again).

bc’s picture

Status: Needs review » Reviewed & tested by the community

The patch in #9 worked for me. I think that this patch improves this module's usabiltiy.

Another approach can be seen in fb_autopost: http://drupalcode.org/project/fb_autopost.git/blob/refs/heads/7.x-1.x:/f...

In addition we can test in the install requirements phase: http://drupalcode.org/project/views_slideshow.git/blob/refs/heads/7.x-3....

__cj’s picture

Status: Reviewed & tested by the community » Needs work

Thanks for the review.

Throwing an exception instead of calling drupal_set_message, and also implementing hook_requirements would both be worth doing - setting back to needs work.

bc’s picture

I can do both of those things sometime this week; stand by for patchery.

levelos’s picture

Status: Needs work » Fixed

Thanks for the input everyone. Committed a variation of #9 in c37803a.

Status: Fixed » Closed (fixed)

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

Vincenzo Gambino’s picture

Hi Levelos,

I've spotted a possible bug in the commit from #13.

You mentioned a variation of the patch from #9, I think from the changes you made there is now a parameter is missing, it should be:

watchdog('mailchimp', $msg, array(), WATCHDOG_ERROR);

rather than

watchdog('mailchimp', $msg, WATCHDOG_ERROR);

If you forget to load the library this missed argument will break admin/reports/dblog page due to a type error.

thanks,
Vincenzo

Vincenzo Gambino’s picture

Status: Closed (fixed) » Needs work
chrisjlee’s picture

Status: Needs work » Fixed

Vicenzo thanks for spotting that. I went ahead and created a separate issue for that. #2063783: Watchdog message missing array parameter causing type error

Status: Fixed » Closed (fixed)

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