diff --git a/chrome/content/zotero/xpcom/collectionTreeView.js b/chrome/content/zotero/xpcom/collectionTreeView.js index e6c8321397..f6f7afcd13 100644 --- a/chrome/content/zotero/xpcom/collectionTreeView.js +++ b/chrome/content/zotero/xpcom/collectionTreeView.js @@ -184,9 +184,9 @@ Zotero.CollectionTreeView.prototype.refresh = Zotero.Promise.coroutine(function* rows, new Zotero.CollectionTreeRow('group', groups[i]), 1, - beforeRow ? beforeRow + i + newRows : null + beforeRow ? beforeRow + newRows : null ); - newRows += yield self._expandRow(rows, row); + newRows += 1 + ( yield self._expandRow(rows, row) ); } return newRows; }) diff --git a/chrome/content/zotero/xpcom/data/items.js b/chrome/content/zotero/xpcom/data/items.js index a9dea54073..b8e51f69e8 100644 --- a/chrome/content/zotero/xpcom/data/items.js +++ b/chrome/content/zotero/xpcom/data/items.js @@ -256,9 +256,6 @@ Zotero.Items = 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)) { @@ -288,7 +285,7 @@ Zotero.Items = function() { } Zotero.debug(obj.itemID); Zotero.debug(Object.keys(this._objectCache)); - this._objectCache[obj.itemID].loadFromRow(rowObj); + this._objectCache[obj.itemID].loadFromRow(obj); }.bind(this) } ); diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js index 61ad19d702..9a2d2b7130 100644 --- a/chrome/content/zotero/xpcom/itemTreeView.js +++ b/chrome/content/zotero/xpcom/itemTreeView.js @@ -302,6 +302,10 @@ Zotero.ItemTreeView.prototype.refresh = Zotero.serial(Zotero.Promise.coroutine(f case 'year': field = 'date'; break; + + case 'itemType': + field = 'itemTypeID'; + break; } if (cacheFields.indexOf(field) == -1) { cacheFields = cacheFields.concat(field);