From 06ce842345c36031a704ab1e86f75332a54a614b Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Sun, 19 Jan 2014 22:24:07 -0500 Subject: [PATCH] Create 008 - take only the first field/subfield combo In the event that there were multiple $a subfields in, say, 044, the create 008 function could spew raw XML into the 008 field. Avoid that by taking the primary instance. Signed-off-by: Dan Scott --- Open-ILS/xul/staff_client/server/cat/marcedit.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.js b/Open-ILS/xul/staff_client/server/cat/marcedit.js index 9237ff9b22..27f5870928 100644 --- a/Open-ILS/xul/staff_client/server/cat/marcedit.js +++ b/Open-ILS/xul/staff_client/server/cat/marcedit.js @@ -65,7 +65,7 @@ function get_new_008() { if (xml_record.datafield.(@tag == '041')) { var field = xml_record.datafield.(@tag == '041')[0]; if (field && field.subfield.(@code == 'a')) { - lang = field.subfield.(@code == 'a'); + lang = field.subfield.(@code == 'a')[0]; } } @@ -74,7 +74,7 @@ function get_new_008() { if (xml_record.datafield.(@tag == '044')) { var field = xml_record.datafield.(@tag == '044')[0]; if (field && field.subfield.(@code == 'a')) { - country = field.subfield.(@code == 'a'); + country = field.subfield.(@code == 'a')[0]; } } while (country.length < 3) country = country + ' '; @@ -85,7 +85,7 @@ function get_new_008() { if (xml_record.datafield.(@tag == '260')) { var field = xml_record.datafield.(@tag == '260')[0]; if (field && field.subfield.(@code == 'c')) { - var tmpd = field.subfield.(@code == 'c').replace(/[^0-9]/g, ''); + var tmpd = field.subfield.(@code == 'c')[0].replace(/[^0-9]/g, ''); if (tmpd.match(/^\d\d\d\d/)) { date1 = tmpd.substr(0, 4); } -- 2.43.2