Selaa lähdekoodia

Fixed a few more bugs in Chado v1.3 install

Stephen Ficklin 9 vuotta sitten
vanhempi
commit
475ab41529

+ 1 - 1
tripal_core/api/tripal_core.chado_schema.api.inc

@@ -289,7 +289,7 @@ function chado_get_version($exact = FALSE, $warn_if_unsupported = FALSE) {
   if (preg_match('/^1\.2\d+$/', $effective_version)) {
     $effective_version = "1.2";
   }
-  if ($warn_if_unsupported and ($effective_version != 1.11 and $effective_version != 1.2 and $effective_version != 'not installed')) {
+  if ($warn_if_unsupported and ($effective_version < 1.11 and $effective_version != 'not installed')) {
     drupal_set_message(t("WARNING: The currently installed version of Chado, v$exact_version, is not fully compatible with Tripal."), 'warning');
   }
   // if the callee has requested the exact version then return it

+ 18 - 3
tripal_core/includes/tripal_core.chado_install.inc

@@ -56,11 +56,14 @@ function tripal_core_chado_load_form_validate($form, &$form_state) {
   // Tripal modules are installed.  This is because the install files
   // of those modules may add content to Chado and reinstalling Chado
   // removes that content which may break the modules.
-
-  if ($form_state['values']['action_to_do'] == "Install Chado v1.2" or
+  if ($form_state['values']['action_to_do'] == "Install Chado v1.3" or
+      $form_state['values']['action_to_do'] == "Install Chado v1.2" or
       $form_state['values']['action_to_do'] == "Install Chado v1.11") {
 
     $modules = system_get_info('module');
+    // The tripal_views module should not be included as it's a rquired
+    // dependency of tripal_core
+    unset($modules['tripal_views']);
     $list = array();
     foreach ($modules as $mname => $module) {
       if (array_key_exists('dependencies', $module) and in_array('tripal_core', $module['dependencies'])) {
@@ -81,6 +84,13 @@ function tripal_core_chado_load_form_validate($form, &$form_state) {
       form_set_error("action_to_do", "You are already at v1.2.  There is no need to upgrade.");
     }
   }
+  if ($form_state['values']['action_to_do'] == "Upgrade Chado v1.2 to v1.3") {
+    // Make sure we are already not at v1.3
+    $real_version = chado_get_version(TRUE);
+    if ($real_version == "1.3") {
+      form_set_error("action_to_do", "You are already at v1.3.  There is no need to upgrade.");
+    }
+  }
 }
 /**
  * Submit Load Chado Schema Form
@@ -134,8 +144,13 @@ function tripal_core_install_chado($action) {
     }
   }
   catch (Exception $e) {
-
+    tripal_chado_install_done();
+    tripal_log($e->getMessage(), 'error');
+    return FALSE;
   }
+  return TRUE;
+
+
 }
 
 /**