diff --git a/mailchimp.install b/mailchimp.install index f5613808187a50a5be7c20011b4853275a669418..8cebb41d44fb90c023111d82cdd2baf48d6a3bda 100644 --- a/mailchimp.install +++ b/mailchimp.install @@ -24,6 +24,20 @@ function mailchimp_requirements($phase) { // Ensure translations don't break at install time $t = get_t(); + if ($phase == 'update') { + $path = drupal_get_path('module', 'libraries') . '/libraries.info'; + $info = drupal_parse_info_file($path); + if (version_compare($info['version'], '7.x-2.0', '<')) { + $requirements['mailchimp'] = array( + 'title' => $t('Mailchimp'), + 'value' => '7.x-2.x', + 'description' => $t('libraries 2.x is required for MailChimp 7.x-2.8 or higher.'), + 'severity' => REQUIREMENT_ERROR + ); + return $requirements; + } + } + // Report Drupal version if (in_array($phase, array('runtime', 'update'))) { $library = libraries_detect('mailchimp'); @@ -46,18 +60,6 @@ function mailchimp_requirements($phase) { ); } } - if ($phase == 'update') { - $path = drupal_get_path('module', libraries) . '/libraries.info'; - $info = drupal_parse_info_file($path); - if (version_compare($info['version'], '7.x-2.0', '<')) { - $requirements['libraries'] = array( - 'title' => $t('Libraries'), - 'value' => '7.x-2.x', - 'description' => $t('libraries 2.x is required for MailChimp.'), - 'severity' => REQUIREMENT_ERROR - ); - } - } return $requirements; }