ソースを参照

Merge branch '6.x-1.x' of git.drupal.org:sandbox/spficklin/1337878 into 6.x-1.x

spficklin 12 年 前
コミット
34cac2dcdc

+ 2 - 1
tripal_bulk_loader/tripal_bulk_loader.module

@@ -295,7 +295,8 @@ function tripal_bulk_loader_form($node, $form_state) {
     '#title'         => t('Data File'),
     '#description'   => t('Please specify the data file to be loaded. This must be a tab-delimited text file with UNIX line endings.'),
     '#weight'        => -8,
-    '#default_value' => $node->file
+    '#default_value' => $node->file,
+    '#maxlength'     => 1024,
   );
 
   $form['loader']['has_header'] = array(

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

@@ -356,7 +356,7 @@ function tripal_core_chado_insert($table, $values, $options = array()) {
         $psql = "PREPARE currval_" . $table . "_" . $field . " AS SELECT CURRVAL('" . $table . "_" . $field . "_seq')";
         $is_prepared = tripal_core_chado_prepare("currval_$table", $psql, array());
         if ($is_prepared) {
-           $value = db_fetch_object(chado_query("EXECUTE currval_$table"));
+           $value = db_result(chado_query("EXECUTE currval_" . $table. "_" . $field));
         }
         else {
           $sql = "SELECT CURRVAL('" . $table . "_" . $field . "_seq')";

+ 8 - 6
tripal_feature/includes/fasta_loader.inc

@@ -603,7 +603,7 @@ function tripal_feature_fasta_loader_handle_feature($name, $uname, $db_id, $acce
       return 0;
     } 
     if (count($results) == 1) {  
-      $reature = $results[0];
+      $feature = $results[0];
     } 
   }
   // check to see if this feature already exists if the match_type is 'Unique Name'
@@ -613,6 +613,7 @@ function tripal_feature_fasta_loader_handle_feature($name, $uname, $db_id, $acce
       'uniquename' => $uname,
       'type_id' => $cvterm->cvterm_id,    
     );
+
     $options = array('statement_name' => 'sel_feature_oruqty');
     $results = tripal_core_chado_select('feature', array('feature_id'), $values, $options);
     if (count($results) > 1) {
@@ -621,7 +622,7 @@ function tripal_feature_fasta_loader_handle_feature($name, $uname, $db_id, $acce
       return 0;
     } 
     if (count($results) == 1) {  
-      $reature = $results[0];
+      $feature = $results[0];
     } 
   }
 
@@ -791,7 +792,7 @@ function tripal_feature_fasta_loader_handle_feature($name, $uname, $db_id, $acce
     }
   }
 
-   // now add the database cross reference
+  // now add the database cross reference
   if ($db_id) {
     // check to see if this accession reference exists, if not add it
     $values = array(
@@ -800,10 +801,11 @@ function tripal_feature_fasta_loader_handle_feature($name, $uname, $db_id, $acce
     );
     $sel_options = array('statement_name' => 'sel_dbxref_dbac');
     $results = tripal_core_chado_select('dbxref', array('dbxref_id'), $values, $sel_options);
+    // if the accession doesn't exist then add it
     if (count($results) == 0) {   
-      $ins_options = array('statement_name' => 'sel_dbxref_dbac');
-      $success = tripal_core_chado_insert('dbxref', $values, $ins_options);
-      if (!$success) {
+      $ins_options = array('statement_name' => 'ins_dbxref_dbac');
+      $results = tripal_core_chado_insert('dbxref', $values, $ins_options);
+      if (!$results) {
         watchdog('T_fasta_loader', "Failed to add database accession '%accession'", 
           array('%accession' => $accession), WATCHDOG_ERROR);
         return 0;