Revert relations purge debugging

This commit is contained in:
Dan Stillman 2013-11-21 20:41:22 -05:00
parent 15710060be
commit 305edd893c

View File

@ -229,34 +229,21 @@ Zotero.Relations = new function () {
var uris = Zotero.DB.columnQuery(sql, [this.deletedItemPredicate, this.deletedItemPredicate]); var uris = Zotero.DB.columnQuery(sql, [this.deletedItemPredicate, this.deletedItemPredicate]);
if (uris) { if (uris) {
var prefix = Zotero.URI.defaultPrefix; var prefix = Zotero.URI.defaultPrefix;
try { Zotero.DB.beginTransaction();
Zotero.DB.beginTransaction(); for each(var uri in uris) {
for each(var uri in uris) { // Skip URIs that don't begin with the default prefix,
Zotero.debug('==='); // since they don't correspond to local items
Zotero.debug(uri); if (uri.indexOf(prefix) == -1) {
continue;
// 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.commitTransaction(); if (uri.indexOf(/\/items\//) != -1 && !Zotero.URI.getURIItem(uri)) {
} this.eraseByURI(uri);
catch (e) { }
Zotero.debug(e); if (uri.indexOf(/\/collections\//) != -1 && !Zotero.URI.getURICollection(uri)) {
Zotero.debug(uris); this.eraseByURI(uri);
var rels = Zotero.DB.query("SELECT * FROM relations");
for each (let rel in rels) {
Zotero.debug(rel);
} }
} }
Zotero.DB.commitTransaction();
} }
} }