Browse Source

Fixed by Chun-huai

Stephen Ficklin 12 years ago
parent
commit
14a4923bdc
2 changed files with 16 additions and 3 deletions
  1. 4 2
      tripal_core/api/tripal_core.api.inc
  2. 12 1
      tripal_stock/tripal_stock.module

+ 4 - 2
tripal_core/api/tripal_core.api.inc

@@ -1258,8 +1258,10 @@ function tripal_core_chado_select($table, $columns, $values, $options = NULL) {
       $psql = drupal_substr($psql, 0, -2);  // get rid of the trailing ', '
     }
     // finish constructing the prepared SQL statement
-    $psql =  "PREPARE " . $options['statement_name'] . " (" . implode(', ', $idatatypes) . ") AS " . $psql;
-
+    if ($options['statement_name']) {
+    	$psql =  "PREPARE " . $options['statement_name'] . " (" . implode(', ', $idatatypes) . ") AS " . $psql;
+    }
+    
   } // end if(empty($where)){ } else {
 
   // if the caller has requested the SQL rather than the results...

+ 12 - 1
tripal_stock/tripal_stock.module

@@ -1117,4 +1117,15 @@ function tripal_stock_preprocess_tripal_organism_stocks(&$variables) {
   }
   
   $organism->stock_browser =  array('stocks' => $stocks, 'pager' => $pager, 'enabled' => TRUE );
-}
+}
+
+/**
+ *
+ *
+ * @ingroup tripal_stock
+ */
+function tripal_stock_preprocess_tripal_stock_base(&$variables) {
+	$stock = $variables['node']->stock;
+	$num_seq = db_result(chado_query("SELECT count(*) FROM feature_stock WHERE stock_id = %d", $stock->stock_id));
+	$stock->num_seq = $num_seq;
+}