diff --git a/chrome/content/zotero/xpcom/data/itemFields.js b/chrome/content/zotero/xpcom/data/itemFields.js index bd82d1b107..a2f4e5621c 100644 --- a/chrome/content/zotero/xpcom/data/itemFields.js +++ b/chrome/content/zotero/xpcom/data/itemFields.js @@ -379,7 +379,8 @@ Zotero.ItemFields = new function() { function _fieldCheck(field, func) { var fieldID = self.getID(field); if (!fieldID) { - throw ("Invalid field '" + field + (func ? "' in ItemFields." + func + "()" : "'")); + Zotero.debug((new Error).stack, 1); + throw new Error("Invalid field '" + field + (func ? "' in ItemFields." + func + "()" : "'")); } return fieldID; } diff --git a/chrome/content/zotero/xpcom/data/items.js b/chrome/content/zotero/xpcom/data/items.js index e8fddb1ef1..abc500e8a4 100644 --- a/chrome/content/zotero/xpcom/data/items.js +++ b/chrome/content/zotero/xpcom/data/items.js @@ -300,6 +300,9 @@ Zotero.Items = new function() { if (this.isPrimaryField(field)) { primaryFields.push(field); } + else if (field == 'itemType') { + primaryFields.push('itemTypeID'); + } else { fieldIDs.push(Zotero.ItemFields.getID(field)); if (Zotero.ItemFields.isBaseField(field)) {