www

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

commit 32aebd388b5506009bd764c1756438beb48e4337
parent c96363746bfc482173a3376138d11fdd188926c5
Author: Dan Stillman <dstillman@zotero.org>
Date:   Mon, 26 Mar 2018 04:48:32 -0400

Fix upgrade error in c96363746b if no related items

Diffstat:
Mchrome/content/zotero/xpcom/schema.js | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js @@ -2416,8 +2416,8 @@ Zotero.Schema = new function(){ else if (i == 100) { let userID = yield Zotero.DB.valueQueryAsync("SELECT value FROM settings WHERE setting='account' AND key='userID'"); - if (userID) { - let predicateID = yield Zotero.DB.valueQueryAsync("SELECT predicateID FROM relationPredicates WHERE predicate='dc:relation'"); + let predicateID = yield Zotero.DB.valueQueryAsync("SELECT predicateID FROM relationPredicates WHERE predicate='dc:relation'"); + if (userID && predicateID) { let rows = yield Zotero.DB.queryAsync("SELECT itemID, object FROM items JOIN itemRelations IR USING (itemID) WHERE libraryID=? AND predicateID=?", [1, predicateID]); for (let row of rows) { let matches = row.object.match(/^http:\/\/zotero.org\/users\/(\d+)\/items\/([A-Z0-9]+)$/);