www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit f2cc2204c9de6603817fce01869b051039d61d2a
parent e8257813f135f8181a06c517ddf64cc4642b92dc
Author: Dan Stillman <dstillman@zotero.org>
Date:   Wed, 21 Jun 2017 06:50:21 -0400

Fix for some child items not showing up

https://forums.zotero.org/discussion/66140/5-0-beta-missing-item-attachments

Diffstat:
Mchrome/content/zotero/xpcom/data/items.js | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/chrome/content/zotero/xpcom/data/items.js b/chrome/content/zotero/xpcom/data/items.js @@ -526,11 +526,12 @@ Zotero.Items = function() { + "LEFT JOIN itemDataValues IDV USING (valueID) " + "LEFT JOIN deletedItems DI USING (itemID) " + "WHERE libraryID=?" - + (ids.length ? " AND parentItemID IN (" + ids.map(id => parseInt(id)).join(", ") + ")" : ""); + + (ids.length ? " AND parentItemID IN (" + ids.map(id => parseInt(id)).join(", ") + ")" : "") + + " ORDER BY parentItemID"; // Since we do the sort here and cache these results, a restart will be required // if this pref (off by default) is turned on, but that's OK if (Zotero.Prefs.get('sortAttachmentsChronologically')) { - sql += " ORDER BY parentItemID, dateAdded"; + sql += ", dateAdded"; } var setAttachmentItem = function (itemID, rows) { var item = this._objectCache[itemID]; @@ -575,9 +576,10 @@ Zotero.Items = function() { + "JOIN items I ON (N.parentItemID=I.itemID) " + "LEFT JOIN deletedItems DI USING (itemID) " + "WHERE libraryID=?" - + (ids.length ? " AND parentItemID IN (" + ids.map(id => parseInt(id)).join(", ") + ")" : ""); + + (ids.length ? " AND parentItemID IN (" + ids.map(id => parseInt(id)).join(", ") + ")" : "") + + " ORDER BY parentItemID"; if (Zotero.Prefs.get('sortNotesChronologically')) { - sql += " ORDER BY parentItemID, dateAdded"; + sql += ", dateAdded"; } var setNoteItem = function (itemID, rows) { var item = this._objectCache[itemID];