Fix error when sorting by Item Type column (since dd477e15b8)

This commit is contained in:
Dan Stillman 2014-05-07 13:45:20 -04:00
parent ebb112890d
commit fd9452adbc
2 changed files with 5 additions and 1 deletions

View file

@ -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;
}

View file

@ -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)) {