# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: millennium.module
--- millennium.module Base (1.13.2.33.2.2.2.90)
+++ millennium.module Locally Modified (Based On 1.13.2.33.2.2.2.90)
@@ -784,20 +784,20 @@
 
     case 'view':
       // Authors
-      $authors_output = "";
-      if ($node->millennium_biblio_data['authors']) {
-        $authors_output .= $node->millennium_biblio_data['authors'];
+      $authors_output = array();
+      if (sizeof($node->millennium_biblio_data['authors']) > 0) {
+        $authors_output += $node->millennium_biblio_data['authors'];
       }
       $author_fields = explode('|', 'secondary_authors|tertiary_authors|corp_author');
       foreach ($author_fields as $field) {
         $author = $node->millennium_biblio_data[$field];
-        if ($author != "") {
-          $authors_output .= ($authors_output != "" ? ", " : "") . trim($author);
+        if (sizeof($author) > 0) {
+          $authors_output += $author;
         }
       }
-      if ($authors_output != "") {
+      if (sizeof($authors_output)) {
         $node->content['millennium_authors'] = array(
-          '#value' => "<div class='millennium authors'>". t('by @authors', array("@authors" => $authors_output)) ."</div>\n",
+          '#value' => "<div class='millennium authors'>". t('by @authors', array('@authors' => implode('; ', $authors_output))) ."</div>\n",
           '#weight' => -91,
         );
       }
@@ -811,16 +811,20 @@
       );
 
       // Determine ISBN for Google Books API
-      $search_isbn = preg_replace('/;.*/', '', str_replace(' ', '', $node->millennium_biblio_data["isbn"]) );
+      if (is_array($node->millennium_biblio_data["isbn"]) && sizeof($node->millennium_biblio_data["isbn"]) > 0) {
+        $search_isbn = $node->millennium_biblio_data["isbn"][0];
+      } else {
+        $search_isbn = '';
+      }
 
       // Add div and JS to handle links to google books
       $gbooks_flag = variable_get('millennium_googlebooks', false);
-      if ($gbooks_flag !== false) {
+      if ($search_isbn && $gbooks_flag !== false) {
         if (
             (!$page && $gbooks_flag == "teaser") || ($page && $gbooks_flag != "No")
           ) {
           drupal_add_js( drupal_get_path('module', 'millennium') .'/millennium_googlebooks.js');
-          drupal_add_js(array('millennium' => array('gbooks' => array($search_isbn => $search_isbn))), 'setting');
+          drupal_add_js(array('millennium' => array('gbooks' => array($node->nid => $search_isbn))), 'setting');
           drupal_add_js(array('millennium' => array('gbooks_replace_covers' => variable_get('millennium_googlebooks_covers', TRUE))), 'setting');
           $node->content['millennium_google_books'] = array(
             '#value' => "<div id='gbooks-link-$search_isbn' class='millennium gbook'></div>",
@@ -830,7 +834,7 @@
       }
 
       // Add div and JS to handle google embedded book reader widget
-      if ($page && variable_get('millennium_googlebooks_widget', 0)) {
+      if ($search_isbn && $page && variable_get('millennium_googlebooks_widget', 0)) {
         drupal_set_html_head('<script src="http://www.google.com/jsapi"></script>');
         drupal_add_js('google.load("books", "0");', 'inline');
         drupal_add_js( drupal_get_path('module', 'millennium') .'/millennium_googlebooks.js');
@@ -1725,7 +1729,7 @@
       }
     }
   }
-  $biblio["notes"] = implode("<br />", $notes);
+  $biblio["notes"] = $notes;
 
   // Links
   $links = array();
@@ -1795,6 +1799,11 @@
     "volume" => "[v]",
   );
 
+  // Define repeatable fields
+  $biblio_repeatable = array(
+    'isbn', 'issn', 'authors', 'corp_author'
+  );
+
   foreach ($tags as $fieldname => $tag) {
     $result = array();
     $found_data = millennium_getFields($marc, "$tag");
@@ -1820,8 +1829,16 @@
         $result[$value] = $value;
       }
     }
+
+    if (in_array($fieldname, $biblio_repeatable)) {
+      // Store repeatable fields as an array
+      $biblio[$fieldname] = array_values($result);
+    }
+    else {
+      // Store non-repeatable fields as a string
     $biblio[$fieldname] = implode("; ", $result);
   }
+  }
\ No newline at end of file
 
   // Check if author found
   if ($biblio["authors"] == "") {
Index: millennium.theme.inc
--- millennium.theme.inc Base (1.1.2.5)
+++ millennium.theme.inc Locally Modified (Based On 1.1.2.5)
@@ -212,7 +212,7 @@
       if (is_string($fieldvalue)) {
         $display = $fieldvalue;
       }
-      elseif (is_array($fieldvalue) && $fieldvalue) {
+      elseif (is_array($fieldvalue) && sizeof($fieldvalue) > 0) {
         $display = theme('item_list', $fieldvalue);
       }
     }
@@ -254,18 +254,16 @@
   $title = str_replace('"', '\"', check_plain($biblio_data['title']));
   if ($override_url) {
     // Determine single isbn (or issn) to use for !id placeholder
-    $first_isbn_issn = trim(preg_replace('/[^0-9X -].*$/i', '', trim($biblio_data["isbn"]) ));
-    if ($first_isbn_issn == "") {
-      $first_isbn_issn = trim(preg_replace('/[^0-9X -].*$/i', '', trim($biblio_data["issn"])));
+    $first_isbn_issn = (!empty($biblio_data["isbn"][0])) ? $biblio_data["isbn"][0] : '';
+    if ($first_isbn_issn == '') {
+      $first_isbn_issn = (!empty($biblio_data["issn"][0])) ? $biblio_data["issn"][0] : '';
     }
-    $first_isbn_issn = preg_replace('/[^0-9X]+/i', '', $first_isbn_issn);
-
     $cover_url = $override_url;
     // Replace placeholders with item's information from $biblio_data
     $cover_url = str_replace("!id", $first_isbn_issn, $cover_url);
     $cover_url = str_replace("!type", $biblio_data["type"], $cover_url);
     $cover_url = str_replace("!tit", urlencode($node->title), $cover_url);
-    $cover_url = str_replace("!aut", urlencode($biblio_data["authors"]), $cover_url);
\ No newline at end of file
+    $cover_url = str_replace("!aut", urlencode(implode(';', $biblio_data["authors"])), $cover_url);
\ No newline at end of file
     // If nothing was replaced, use blank cover's image url
     if ($cover_url == str_replace(array('!id', '!type', '!tit', '!aut'), '', $override_url)) {
       $cover_url = $blank_url;
Index: tests/millennium_basic_functions.test
--- tests/millennium_basic_functions.test Base (1.1.2.3)
+++ tests/millennium_basic_functions.test Locally Modified (Based On 1.1.2.3)
@@ -45,7 +45,7 @@
       'biblio_data' => array(
         'title' => 'Breeding strategies for resistance to the rusts of wheat',
         'lcc' => 'SB 191.W5 S5 1988',
-        'authors' => 'Simmonds, N. W; Rajaram, S',
+        'authors' => array('Simmonds, N. W', 'Rajaram, S'),
         'item_description' => '151 p. : ill. &#59; 25 cm',
         // TODO: Add more fields to compare
       )
@@ -74,7 +74,7 @@
       'biblio_data' => array(
         'title' => 'Pro Drupal development',
         'lcc' => 'TK5105.8885.D78 V36 2008',
-        'authors' => 'VanDyk, John K',
+        'authors' => array('VanDyk, John K'),
         'item_description' => 'xxxiii, 667 p. : il. ; 24 cm.',
         // TODO: Add more fields to compare
       )
