From 305edd893cdf0088e97a1f9fc1338fd15466d229 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 21 Nov 2013 20:41:22 -0500 Subject: [PATCH] Revert relations purge debugging --- chrome/content/zotero/xpcom/data/relations.js | 37 ++++++------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/relations.js b/chrome/content/zotero/xpcom/data/relations.js index f0b8b3968..323488362 100644 --- a/chrome/content/zotero/xpcom/data/relations.js +++ b/chrome/content/zotero/xpcom/data/relations.js @@ -229,34 +229,21 @@ Zotero.Relations = new function () { var uris = Zotero.DB.columnQuery(sql, [this.deletedItemPredicate, this.deletedItemPredicate]); if (uris) { var prefix = Zotero.URI.defaultPrefix; - try { - Zotero.DB.beginTransaction(); - for each(var uri in uris) { - Zotero.debug('==='); - Zotero.debug(uri); - - // Skip URIs that don't begin with the default prefix, - // since they don't correspond to local items - if (uri.indexOf(prefix) == -1) { - continue; - } - if (uri.indexOf(/\/items\//) != -1 && !Zotero.URI.getURIItem(uri)) { - this.eraseByURI(uri); - } - if (uri.indexOf(/\/collections\//) != -1 && !Zotero.URI.getURICollection(uri)) { - this.eraseByURI(uri); - } + Zotero.DB.beginTransaction(); + for each(var uri in uris) { + // Skip URIs that don't begin with the default prefix, + // since they don't correspond to local items + if (uri.indexOf(prefix) == -1) { + continue; } - Zotero.DB.commitTransaction(); - } - catch (e) { - Zotero.debug(e); - Zotero.debug(uris); - var rels = Zotero.DB.query("SELECT * FROM relations"); - for each (let rel in rels) { - Zotero.debug(rel); + if (uri.indexOf(/\/items\//) != -1 && !Zotero.URI.getURIItem(uri)) { + this.eraseByURI(uri); + } + if (uri.indexOf(/\/collections\//) != -1 && !Zotero.URI.getURICollection(uri)) { + this.eraseByURI(uri); } } + Zotero.DB.commitTransaction(); } }