summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel Carleton-Barnes2013-01-24 23:32:47 (GMT)
committer Gabriel Carleton-Barnes2013-01-24 23:32:47 (GMT)
commit0e125efdf9f4ecc323b111efe2d118ecaf3ae04a (patch)
treea69966838574fc9c47a9be9c199ae0047f63076c
parentfd4feb36a2183fade340fd45cbcf8cf78d462f3d (diff)
rearranging update tests to make the libraries version confirmation occur before the call to the new libraries version's functions.
-rw-r--r--mailchimp.install26
1 files changed, 14 insertions, 12 deletions
diff --git a/mailchimp.install b/mailchimp.install
index f561380..8cebb41 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;
}