Browse Source

Stock: Updated load to use a preset stock_id rather then always using chado_get_id_from_nid

Lacey Sanderson 11 years ago
parent
commit
87dd5df1fd
1 changed files with 6 additions and 1 deletions
  1. 6 1
      tripal_stock/includes/tripal_stock.chado_node.inc

+ 6 - 1
tripal_stock/includes/tripal_stock.chado_node.inc

@@ -56,7 +56,12 @@ function chado_stock_load($nodes) {
   foreach ($nodes as $nid => $node) {
 
     // get the stock details from chado
-    $stock_id = chado_get_id_from_nid('stock', $nid);
+    if (isset($node->stock_id)) {
+      $stock_id = $node->stock_id;
+    }
+    else {
+      $stock_id = chado_get_id_from_nid('stock', $nid);
+    }
 
     // if the nid does not have a matching record then skip this node.
     // this can happen with orphaned nodes.