From 80924040fb8bfb7510171a0ca4671635682135ad Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 12 Jul 2010 11:37:47 +0000 Subject: [PATCH] closes #1427, PATCH: MODS [physicalDescription = "electronic" > itemType "webpage"] could cause problems closes #1579, PATCH: MODS translator should separate titles and subTitles once again, thanks to karnesky --- translators/MODS.js | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/translators/MODS.js b/translators/MODS.js index b983658791..201e1aa24a 100644 --- a/translators/MODS.js +++ b/translators/MODS.js @@ -459,6 +459,12 @@ function doImport() { // dropping other title types so they don't overwrite the main title // we have same behaviour in the MARC translator if(!titleInfo.@type.toString()) { + if (titleInfo.m::title.length()){ + newItem.title = titleInfo.m::title.text().toString(); + if (titleInfo.m::subTitle.length()) { + newItem.title = newItem.title + ": " + titleInfo.m::subTitle.text().toString(); + } + } else { newItem.title = titleInfo.*.text(); // including text from sub elements } } @@ -485,19 +491,7 @@ function doImport() { } } - // check if this is an electronic resource - if(!newItem.itemType) { - for each(var form in mods.m::physicalDescription.m::form) { - if(form.@authority == "marcform" || form.@authority == "marc") { - if(form.text().toString() == "electronic") { - newItem.itemType = "webpage"; - break; - } - } - } - - if(!newItem.itemType) newItem.itemType = "document"; - } + if(!newItem.itemType) newItem.itemType = "document"; } var isPartialItem = Zotero.Utilities.inArray(newItem.itemType, partialItemTypes); @@ -709,4 +703,4 @@ function doImport() { newItem.complete(); } -} \ No newline at end of file +}