Browse Source

Fixed bug in updating pubs

spficklin 12 years ago
parent
commit
57c47bbf42

+ 5 - 2
tripal_pub/api/tripal_pub.api.inc

@@ -100,7 +100,7 @@ function tripal_pub_get_raw_data($dbxref) {
     $search['num_criteria'] = 0;
     $pubs = tripal_pub_get_remote_search_results($remote_db, $search, 1, 0);
     
-    return '<textarea cols=80 rows=20>' . $pubs[0]['xml'] . '</textarea>';
+    return '<textarea cols=80 rows=20>' . $pubs[0]['raw'] . '</textarea>';
   }  
   return 'Invalid DB xref';    
 }
@@ -566,7 +566,10 @@ function tripal_pub_add_publication($pub_details, $do_contact = FALSE, $update =
   } 
   
   foreach ($pub_details as $key => $value) {
-     
+     // the pub_details may have the raw search data (e.g. in XML from PubMed.  We'll irgnore this for now
+     if($key == 'raw') {
+       continue;
+     }         
      // get the cvterm by name or synonym
      $cvterm = tripal_cv_get_cvterm_by_name($key, NULL, 'tripal_pub');
      if (!$cvterm) {

+ 1 - 1
tripal_pub/includes/pubmed.inc

@@ -335,7 +335,7 @@ function tripal_pub_PMID_parse_pubxml($pub_xml) {
     $pub['Citation'] .= ':' . $pub['Pages'];
   }
   
-  $pub['xml'] = $pub_xml;
+  $pub['raw'] = $pub_xml;
   return $pub;
 }
 

+ 5 - 1
tripal_pub/tripal_pub.module

@@ -548,6 +548,10 @@ function chado_pub_update($node) {
         $publisher = $value;
         unset($properties[$name]);
       }
+      elseif ($name == "Journal Name") {
+        $series_name = $value;
+        unset($properties[$name]);
+      }
       elseif ($name == "Journal Country" or $name == "Published Location") {
         $pubplace = $value;
         unset($properties[$name]);
@@ -566,11 +570,11 @@ function chado_pub_update($node) {
   );
   $values = array(
     'title'       => trim($node->title),
-    'series_name' => trim($node->series_name),
     'type_id'     => trim($node->type_id),
     'pyear'       => trim($node->pyear),
     'is_obsolete' => $node->is_obsolete ? 'true' : 'false', 
     'uniquename'  => trim($node->uniquename),
+    'series_name' => $series_name,
     'volumetitle' => $volumetitle,
     'volume'      => $volume,    
     'issue'       => $issue,