From 69c27cd8a7dd0dda989ee3aecc3fd76a11841fe4 Mon Sep 17 00:00:00 2001
From: Dan Stillman <dstillman@zotero.org>
Date: Fri, 1 Sep 2017 17:44:18 -0400
Subject: [PATCH] Fix potential failure with full-text phrase search

Phrase searches weren't scoped to the current library, so they could
return unloaded items in other libraries and cause the search to fail.
---
 chrome/content/zotero/xpcom/collectionTreeRow.js | 1 +
 1 file changed, 1 insertion(+)

diff --git a/chrome/content/zotero/xpcom/collectionTreeRow.js b/chrome/content/zotero/xpcom/collectionTreeRow.js
index 829f25387..150bcdac7 100644
--- a/chrome/content/zotero/xpcom/collectionTreeRow.js
+++ b/chrome/content/zotero/xpcom/collectionTreeRow.js
@@ -343,6 +343,7 @@ Zotero.CollectionTreeRow.prototype.getSearchObject = Zotero.Promise.coroutine(fu
 	
 	// Create the outer (filter) search
 	var s2 = new Zotero.Search();
+	s2.addCondition('libraryID', 'is', this.ref.libraryID);
 	
 	if (this.isTrash()) {
 		s2.addCondition('deleted', 'true');