Mailchimp library is not being loaded when used as a dependency in an installation. The dependency is defined both in info file of the profile and the enabled during install profile tasks in a batch. During the installation following error is reported (many many time):

Failed to load MailChimp PHP library. Please refer to the installation requirements..

Variable $libraries in

$library = libraries_load('mailchimp'); is returned empty. I tried to add following:

cache_clear_all(NULL, 'cache_libraries');
drupal_static_reset();
$lib_info = libraries_detect('mailchimp');

but without success, and $lib_info is empty as well. As soon the install profile finishes, the library is ready $lib_info and $libraries are filled and work correctly. I found another thread for the same issue, but not in install profile with recommendation to clear caches, but solved the issue in that case, but it's rather difficult to do it in the install profile installation process.

Comments

david.lukac created an issue. See original summary.

david.lukac’s picture

david.lukac’s picture

Status: Active » Needs work

I'm running into similar issue with Cloudinary module in some cases after installation of a profile. Can't even clear caches via Drush. Rebuilding registry via Registry Rebuild module doesn't help either. Solution was to add libraries_load('cloudinary'); into the init function, but that is applicable only when this happens locally, it would be much more trouble to have to do a proper hotfix process to production and then reverting the code. Perhaps an improvement of clearing caches hook with proper rebuilding libraries info would solve it. I'm happy to help as we are actively use this (with the installation profiles) on couple of projects and we are running into this sort of issues and it's time consuming to have to re-install the profile because of this.

tstoeckler’s picture

It would be useful to have some example code to test this with, as I have never hit this use-case myself. Would it be sufficient to have an install profile try to install the Cloudinary module as a dependency?

fuzzy76’s picture