Hello,

I have uploaded the Mailchimp 7.x-3.1 files to 'sites/all/modules/mailchimp' but when performing PHP update in Drupal I got the following fatal error: Class 'Mailchimp' not found in 'sites/all/modules/mailchimp/includes/mailchimp.inc' on line 13.

Is there a problem with the code in mailchimp.inc?

Many thanks in advance.

Greetings

Tom

CommentFileSizeAuthor
#3 mailchimp.png10.66 KBAlperian
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

GrigoriuNicolae’s picture

Maybe you should try clear the cache, but not using drush

Alperian’s picture

I have this problem also. This occurred when I tried to save the API key in configuration. I cleared cache after install. All went ok. Now it won't allow cache to be cleared. Error is:

Fatal error: Class 'Mailchimp' not found in /URL/sites/all/modules/mailchimp/includes/mailchimp.inc on line 13

I can't even open the modules page sadly.

Mailchimp 2.0 api

Alperian’s picture

FileSize
10.66 KB

This is easily reproducible. I am using
Drupal: 7.31
PHP version: 5.5.15
Mailchimp module: 7.x-3.1

I have them in the libraries folder as shown in attached image.

The only thing that clearing cache does is cause the error faster.

I really hope that it is something that I am doing wrong.

GrigoriuNicolae’s picture

@Alperian, I tried to reproduce your problem and I have found that problem is in the mailchimp library. Could you try this library Mailchimp Library. I am not sure, but try to keep library name with lowercase letters.
P.S. Sorry for bad english :P

Alperian’s picture

Grigoriu Nicolae. Many thanks. Working now. Nothing wrong with your English.

ruscoe’s picture

Status: Active » Closed (cannot reproduce)

@tommie-boy, please take a look at the Installation Notes, which cover the correct location for the MailChimp library (available here.)

Please reopen this ticket if that doesn't work out for you.

wOOge’s picture

Using API version 2.0.6 worked for me (as specified in the installation instructions)

opdavies’s picture

I'm also having this when updating from 7.x-3.2

I'm also having this on a legacy site that I've inherited. It's currently running mailchimp 7.x-3.2 in sites/all/modules/contrib, and the library is located in profiles/commerce_kickstart/libraries and is removed when I rebuild the site from the commerce_kickstart Drush make file. I needed to re-download it and put it back in it's original location for the site to load, otherwise I was getting the error.

Running drush cc all and drush rr has no affect when moving the library into sites/all/libraries so it seems like I'm stuck with it as it is for now.

maestrojed’s picture

I just had this issue and found a solution not discussed.

I had moved the location of my library files for mailchimp. I started getting this error. I assumed drupal was looking for the old path.

Like opdavies I thought 'drush rr' should update the paths and 'drush cc all' would clear any cached paths. But running those commands would throw this same error and not fix it.

I found that the cache table `cache_libraries` did have serialized data that included the old path. So I truncated cache_libraries directly via MySQL. This worked and fixed my issues.

Nil.Ned’s picture

Dear friend,
I have a similar problem, I'll try to explain my problem:
1) I developed a personal module that works with mailchimp apiV2 (a lot of time ago)
2) everything works fine and I use mailchimp module and library V2

3) Now I'll migrate mailchimp from V2 to V3 and I followed all steps describeted in the official page here
from line 43 to line 55 and from line 91 to line 122
4) everything is right apparently but when I try to run something like " $mailChimp = new MailChimp ( $apikey ); " the result is "Fatal error: Class 'MailChimp' not found in C:\xampp\htdocs\XXXXXXXXXXXXXXXX\XXXXX_manager.module on line 190 " (exactly where I launch it
I think that is a good idea to implement a hook function official like module_libraries_info()
but if I try to insert this code to check if library is correctly installed (the result is ok)

$name = "mailchimp";
	$library = libraries_detect($name);
	
	mailchimp_get_api_object ();
		
	dpm($apikey);
	//$mailChimp = new mailchimp ( XXXXXXXXXXXXXXXXXXX);
	if (($library = libraries_detect($name)) && !empty($library['installed'])) {
		// The library is installed. Awesome!
		dpm("exists");		
	}
	else {
		dpm("not exists");
		// Something went wrong. :(
		// This contains a short status code of what went wrong, such as 'not found'.
		$error = $library['error'];
		// This contains a detailed (localized) error message.
		$error_message = $library['error message'];
	}

the results is EXISTS and library is correctly installed (apparently) but the errorr just try to call mailchimp class the error come back.

I try to truncate cache library table but nothing.

I don't know how can I solve this problem and why with V2 version everything works fine but with V3 version everything is broken. Blah... I'm getting crazy!

If someone have a suggestion I hear it :)
Many thanks in advance.

Greetings

Nil.Ned