hello when navigationg to admin/config with mailchimp and it's 3 sub modules installed I get the following error:

Fatal error: Class 'Mailchimp' not found in modules/mailchimp/src/DrupalMailchimp.php on line 19

I'm using d8 rc3. Tried using latest dev however it's still showing.

Comments

kingfisher64 created an issue. See original summary.

Greg Boggs’s picture

This looks like a bug in our mailchimp library detection. Mailchimp not found means it can't find the mailchimp library.

promount’s picture

I had this error when first installed the module. Maybe sounds obvious but do you have the library installed? I followed the instructions in here https://www.drupal.org/node/2405811 and the error was gone.

kingfisher64’s picture

@promount - I think it's exactly that. I didn't, but wasn't expecting it to throw a fatal, but just report library missing on reports screen.

Will have a look asap.

Greg Boggs’s picture

Thanks for the report, we'll be improving this shortly.

kingfisher64’s picture

Super, will report back as soon as new dev is available.

Would you put the library status on the report page and clarify the path in 8 on the project homepage.

DrupalMailchimp.php is not used in d7 version and is the relevant files are output to libraries/mailchimp/...

The D8 library is referencing a library location within the module sub directory. Can this be changed to libraries/mailchimp/DrupalMailchimp.php?

Finabluma’s picture

I've been struggling to be able to use this module. All the time same error. I follow all recomendations I could read without success...
Fatal error: Class 'Mailchimp' not found in /Users/.../Sites/devdesktop/oscar/modules/mailchimp/src/DrupalMailchimp.php on line 19

kingfisher64’s picture

2015-Dec-03 dev version still is not working.

#6 re-iterated again :)

Rev314159’s picture

I followed the advice from #3, but it still fails. I have gotten #3 to work for other libraries and they load just fine. Also, on the composer report page on admin/reports/composer-manager, it lists that the library is loaded fine. Only when I go to certain config pages, I get the WSOD. From what I can tell, it appears line 11 in DrupalMailchimp.php (in the src folder) does not actually load the Class all of the time, if any. This is line 11:

use Mailchimp;

So, in the meantime, I inserted my own (old school) include statement after line 11 and it seemed to fix the problem.

require_once (__DIR__ . '/../../../vendor/mailchimp/mailchimp/src/Mailchimp.php');
agialab’s picture

A little less 'relative' would be:

require_once ($_SERVER['DOCUMENT_ROOT']. '/vendor/mailchimp/mailchimp/src/Mailchimp.php');

(which works)

Another option is to add the libraries dependency to the project and do it that way.
After some research I have yet to find a good solution to include /vendor libraries in projects...

bkeller’s picture

I used #10 - worked for me - thank you.

taherpro’s picture

#10 solves the issue, Thanks

RKopacz’s picture

Has the fix in #10 been committed to the dev version, does anyone know? I'd like to be able to use this module but I am getting the same error.

ruscoe’s picture

Status: Active » Fixed

The library has been bundled with the module since 8.x-1.0, as a lot of people were having issues with the Composer approach. I recommend upgrading to the latest - 8.x-1.1.

Status: Fixed » Closed (fixed)

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