Browse Source

Fixed bug in Mview creation

spficklin 12 years ago
parent
commit
e95db7502e

+ 8 - 0
tripal_core/api/tripal_core.api.inc

@@ -2602,10 +2602,18 @@ function tripal_db_persistent_chado() {
   else {
     if (is_array($db_url) && isset($db_url['chado'])) {
       $connection = db_connect($db_url['chado']);
+      if (!$connection) {
+        watchdog('tripal_core', "Could not create persistant connection", array(), WATCHDOG_ERROR);
+        return FALSE;       
+      }
       variable_set('tripal_persistent_chado', serialize($connection));
     }
     else {
       $connection = db_connect($db_url);
+      if (!$connection) {
+        watchdog('tripal_core', "Could not create persistant connection", array(), WATCHDOG_ERROR);
+        return FALSE;      	
+      }
       variable_set('tripal_persistent_chado', serialize($connection));
     }
     return $connection;

+ 1 - 1
tripal_core/includes/mviews.php

@@ -92,7 +92,7 @@ function tripal_add_mview($name, $modulename, $mv_table, $mv_specs, $indexed,
     // create the table differently depending on if it the traditional method
     // or the Drupal Schema API method
     if ($mv_schema) {
-      if (!tripal_create_chado_table ($ret, $mv_table, $schema_arr)) {
+      if (!tripal_core_create_custom_table ($ret, $mv_table, $schema_arr)) {
         drupal_set_message(t("Could not create the materialized view. Check Drupal error report logs."), 'error');
       }
       else {

+ 1 - 1
tripal_core/tripal_core.module

@@ -67,7 +67,7 @@ function tripal_core_init() {
   
   // make sure the current version of chado is set
   tripal_core_set_chado_version();  
-  
+    
 }
 
 /**