Explorar o código

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

Lacey Sanderson %!s(int64=11) %!d(string=hai) anos
pai
achega
87dd5df1fd
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  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.