Browse Source

Fixed revisions in update

spficklin 12 years ago
parent
commit
bc6d1b4c41
1 changed files with 19 additions and 21 deletions
  1. 19 21
      tripal_organism/tripal_organism.module

+ 19 - 21
tripal_organism/tripal_organism.module

@@ -779,30 +779,28 @@ function chado_organism_update($node) {
   if ($node->revision) {
   if ($node->revision) {
     // TODO -- decide what to do about revisions
     // TODO -- decide what to do about revisions
   }
   }
-  else {
-    $match = array(
-      'organism_id' => chado_get_id_for_node('organism', $node),
-    );
-    $values = array(
-      'genus' => $node->genus,
-      'species' => $node->species,
-      'abbreviation' => $node->abbreviation,
-      'common_name' => $node->common_name,
-      'comment' => $node->description
-    );
-    $org_status = tripal_core_chado_update('organism', $match, $values);
 
 
-    // set the title for the node
-    $record = new stdClass();
-    $record->title = "$node->genus $node->species";
-    $record->nid = $node->nid;
-    drupal_write_record('node', $record, 'nid');
-    drupal_write_record('node_revisions', $record, 'nid');
+  $match = array(
+    'organism_id' => chado_get_id_for_node('organism', $node),
+  );
+  $values = array(
+    'genus' => $node->genus,
+    'species' => $node->species,
+    'abbreviation' => $node->abbreviation,
+    'common_name' => $node->common_name,
+    'comment' => $node->description
+  );
+  $org_status = tripal_core_chado_update('organism', $match, $values);
 
 
-    // add the image
-    chado_organism_add_image($node);
+  // set the title for the node
+  $record = new stdClass();
+  $record->title = "$node->genus $node->species";
+  $record->nid = $node->nid;
+  drupal_write_record('node', $record, 'nid');
+  drupal_write_record('node_revisions', $record, 'nid');
 
 
-  }
+  // add the image
+  chado_organism_add_image($node);
 }
 }
 /**
 /**
  * Delete organism from both drupal and chado databases. Check dependency before
  * Delete organism from both drupal and chado databases. Check dependency before