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) {
var textMappings = CSL_TEXT_MAPPINGS[variable];
for(var i=0; i<textMappings.length; i++) {
var field = textMappings[i],
fieldID = Zotero.ItemFields.getID(field);
var field = textMappings[i];
// Until 5.0, use version instead of versionNumber
if (field == 'versionNumber') field = 'version';
var fieldID = Zotero.ItemFields.getID(field);
if(Zotero.ItemFields.isBaseField(fieldID)) {
var newFieldID = Zotero.ItemFields.getFieldIDFromTypeAndBase(itemTypeID, fieldID);
if(newFieldID) fieldID = newFieldID;