From fd9452adbc1fa6966822ac5b1e647b9e8f624445 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 7 May 2014 13:45:20 -0400 Subject: [PATCH] Fix error when sorting by Item Type column (since dd477e15b8) --- chrome/content/zotero/xpcom/data/itemFields.js | 3 ++- chrome/content/zotero/xpcom/data/items.js | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) 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)) {