Child items of deleted items appeared in gray (i.e., not deleted) in Trash
This commit is contained in:
parent
3e7f1f0608
commit
99d19f35f7
1 changed files with 12 additions and 2 deletions
|
@ -1004,9 +1004,19 @@ Zotero.Search.prototype._buildQuery = function(){
|
|||
}
|
||||
}
|
||||
|
||||
// Exclude deleted items by default
|
||||
// Exclude deleted items (and their child items) by default
|
||||
sql += " WHERE itemID " + (deleted ? "" : "NOT ") + "IN "
|
||||
+ "(SELECT itemID FROM deletedItems)";
|
||||
+ "("
|
||||
+ "SELECT itemID FROM deletedItems "
|
||||
+ "UNION "
|
||||
+ "SELECT itemID FROM itemNotes "
|
||||
+ "WHERE sourceItemID IS NOT NULL AND "
|
||||
+ "sourceItemID IN (SELECT itemID FROM deletedItems) "
|
||||
+ "UNION "
|
||||
+ "SELECT itemID FROM itemAttachments "
|
||||
+ "WHERE sourceItemID IS NOT NULL AND "
|
||||
+ "sourceItemID IN (SELECT itemID FROM deletedItems) "
|
||||
+ ")";
|
||||
|
||||
if (noChildren){
|
||||
sql += " AND (itemID NOT IN (SELECT itemID FROM itemNotes "
|
||||
|
|
Loading…
Reference in a new issue