Fix import of computerProgram exported as CSL JSON

This commit is contained in:
Aurimas Vinckevicius 2015-08-04 15:19:33 -05:00
parent bb15336fdb
commit c4cd7ce3e0

View file

@ -1668,8 +1668,13 @@ Zotero.Utilities = {
if(variable in cslItem) { if(variable in cslItem) {
var textMappings = CSL_TEXT_MAPPINGS[variable]; var textMappings = CSL_TEXT_MAPPINGS[variable];
for(var i=0; i<textMappings.length; i++) { for(var i=0; i<textMappings.length; i++) {
var field = textMappings[i], var field = textMappings[i];
fieldID = Zotero.ItemFields.getID(field);
// Until 5.0, use version instead of versionNumber
if (field == 'versionNumber') field = 'version';
var fieldID = Zotero.ItemFields.getID(field);
if(Zotero.ItemFields.isBaseField(fieldID)) { if(Zotero.ItemFields.isBaseField(fieldID)) {
var newFieldID = Zotero.ItemFields.getFieldIDFromTypeAndBase(itemTypeID, fieldID); var newFieldID = Zotero.ItemFields.getFieldIDFromTypeAndBase(itemTypeID, fieldID);
if(newFieldID) fieldID = newFieldID; if(newFieldID) fieldID = newFieldID;