commit fd9452adbc1fa6966822ac5b1e647b9e8f624445 parent ebb112890d5569def5064789439e4f1dba6f33fd Author: Dan Stillman <dstillman@zotero.org> Date: Wed, 7 May 2014 13:45:20 -0400 Fix error when sorting by Item Type column (since dd477e15b8) Diffstat:
| M | chrome/content/zotero/xpcom/data/itemFields.js | | | 3 | ++- |
| M | 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 @@ -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 @@ -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)) {