Fix for some child items not showing up

https://forums.zotero.org/discussion/66140/5-0-beta-missing-item-attachments
This commit is contained in:
Dan Stillman 2017-06-21 06:50:21 -04:00
parent e8257813f1
commit f2cc2204c9

View file

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