Procházet zdrojové kódy

Bug fix in AGL importer

spficklin před 11 roky
rodič
revize
f299bb56c3
1 změnil soubory, kde provedl 19 přidání a 14 odebrání
  1. 19 14
      tripal_pub/includes/importers/AGL.inc

+ 19 - 14
tripal_pub/includes/importers/AGL.inc

@@ -784,21 +784,26 @@ function tripal_pub_AGL_parse_pubxml($pub_xml) {
   }
 
   // build the full authors list
-  foreach ($pub['Author List'] as $author) {
-    if ($author['valid'] == 'N') {
-      // skip non-valid entries.  A non-valid entry should have
-      // a corresponding corrected entry so we can saftely skip it.
-      continue;
-    }
-    if ($author['Collective']) {
-      $authors .= $author['Collective'] . ', ';
-    }
-    else {
-      $authors .= $author['Surname'] . ' ' . $author['First Initials'] . ', ';
-    }
+  if (is_array($pub['Author List'])) {
+	  foreach ($pub['Author List'] as $author) {
+	    if ($author['valid'] == 'N') {
+	      // skip non-valid entries.  A non-valid entry should have
+	      // a corresponding corrected entry so we can saftely skip it.
+	      continue;
+	    }
+	    if ($author['Collective']) {
+	      $authors .= $author['Collective'] . ', ';
+	    }
+	    else {
+	      $authors .= $author['Surname'] . ' ' . $author['First Initials'] . ', ';
+	    }
+	  }
+	  $authors = substr($authors, 0, -2);
+	  $pub['Authors'] = $authors;
+  }
+  else {
+    $pub['Authors'] = $pub['Author List'];	
   }
-  $authors = substr($authors, 0, -2);
-  $pub['Authors'] = $authors;
 
   // build the citation
   $pub['Citation'] = tripal_pub_create_citation($pub);