Browse Source

Debugging analysis module not instlaling

spficklin 12 years ago
parent
commit
c1944ecf5f

+ 18 - 5
tripal_analysis/tripal_analysis.install

@@ -8,7 +8,6 @@
  * Implementation of hook_install().
  */
 function tripal_analysis_install() {
-	tripal_db_set_default_search_path();
 
   // create the module's data directory
   tripal_create_moddir('tripal_analysis');
@@ -31,10 +30,24 @@ function tripal_analysis_install() {
     chado_query($sql);
   }
 
-  tripal_cv_add_cvterm(array('name' => 'analysis_type', 'def' => 'The type of analysis was performed. This value is automatically set by each Tripal Analysis module and should be equal to the module name (e.g. tripal_analysis_blast, tripal_analysis_go).'), 'tripal', 0, 1, 'tripal');
-  tripal_cv_add_cvterm(array('name' => 'analysis_date', 'def' => 'The date that an analysis was performed.'), 'tripal', 0, 1, 'tripal');
-  tripal_cv_add_cvterm(array('name' => 'analysis_short_name', 'def' => 'A computer legible (no spaces ' .
-      'or special characters) abbreviation for the analysis.'), 'tripal', 0, 1 , 'tripal');
+  // add some cvterms
+  $term = array(
+    'name' => 'analysis_type', 
+    'def' => 'The type of analysis was performed. This value is automatically set by '.
+             'each Tripal Analysis module and should be equal to the module name '.
+             '(e.g. tripal_analysis_blast, tripal_analysis_go).'
+  );
+  tripal_cv_add_cvterm($term, 'tripal', 0, 1, 'tripal');
+  $term = array(
+    'name' => 'analysis_date', 
+    'def' => 'The date that an analysis was performed.'
+  );
+  tripal_cv_add_cvterm($term,'tripal', 0, 1, 'tripal');
+  $term = array(
+    'name' => 'analysis_short_name', 
+    'def' => 'A computer legible (no spaces or special characters) abbreviation for the analysis.'
+  );     
+  tripal_cv_add_cvterm($term,'tripal', 0, 1 , 'tripal');
 }
 
 /**

+ 3 - 26
tripal_core/api/tripal_core.api.inc

@@ -2411,7 +2411,7 @@ function tripal_get_moddir($module_name) {
  *
  * @ingroup tripal_chado_api
  */
-function tripal_db_set_active($dbname = 'default') {
+function tripal_db_set_active($dbname) {
   global $db_url, $db_type;
   $chado_exists = 0;
 
@@ -2433,8 +2433,8 @@ function tripal_db_set_active($dbname = 'default') {
       return db_set_active($dbname);
     }
     // if the user requests a database other than the default
-    // then we need to try and set the search path.  This
-    // only works if the schema is local to the Drpual database. If it
+    // then we need to try and set the chado search path.  This
+    // only works if Chado is local to the Drpual database. If it
     // fails then we assume the database is not local and we'll
     // set it as normal.
     else {
@@ -3165,26 +3165,3 @@ function tripal_core_clean_orphaned_nodes($table, $job_id) {
 
   return '';
 }
-
-/**
- * Check whether chado is installed (either in the same or a different database)
- *
- * @return
- *   TRUE/FALSE depending upon whether chado is installed.
- *
- * @ingroup tripal_chado_api
- */
-function tripal_core_is_chado_installed() {
-  global $db_url, $db_type;
-
-  // first check if chado is in the db_url of the
-  // settings.php file
-  if (is_array($db_url)) {
-    if (isset($db_url['chado'])) {
-      return TRUE;
-    }
-  }
-
-  // check to make sure the chado schema exists
-  return tripal_core_chado_schema_exists();
-}

+ 9 - 8
tripal_core/tripal_core.module

@@ -25,9 +25,18 @@ require_once "api/tripal_core.api.inc";
 function tripal_core_init() {
   global $base_url;
   
+  // make sure we are in the public schema. If there is an errant
+  // module that doesn't properly set the search path back, then
+  // we'll have issues
+  tripal_db_set_default_search_path();
+  
   // create the 'tripal' controlled volcabulary in chado but only if it doesn't already exist, and
   // only if the chado database is present.
   if (tripal_core_is_chado_installed()) {
+  	
+  	// make sure the current version of chado is set
+    tripal_core_set_chado_version();  
+  
     if (!db_fetch_object(chado_query("SELECT * FROM {cv} WHERE name = 'tripal'"))) {
       $results = chado_query(
         "INSERT INTO {cv} (name,definition) ".
@@ -54,14 +63,6 @@ function tripal_core_init() {
   // otherwise PostgreSQL version that may have a different datestyle setting
   // will fail when inserting or updating a date column in a table.
   db_query("SET DATESTYLE TO '%s'", 'MDY');
-  
-  // make sure the current version of chado is set
-  tripal_core_set_chado_version();  
-  
-  // make sure we are in the public schema. If there is an errant
-  // module that doesn't properly set the search path back, then
-  // we'll have issues
-  tripal_db_set_default_search_path();
     
 }