Debugging and temporary fix for relations purging issue
This commit is contained in:
parent
2ca0d159b5
commit
6a0c623698
|
@ -229,21 +229,27 @@ 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;
|
||||||
Zotero.DB.beginTransaction();
|
try {
|
||||||
for each(var uri in uris) {
|
Zotero.DB.beginTransaction();
|
||||||
// Skip URIs that don't begin with the default prefix,
|
for each(var uri in uris) {
|
||||||
// since they don't correspond to local items
|
// Skip URIs that don't begin with the default prefix,
|
||||||
if (uri.indexOf(prefix) == -1) {
|
// since they don't correspond to local items
|
||||||
continue;
|
if (uri.indexOf(prefix) == -1) {
|
||||||
}
|
continue;
|
||||||
if (uri.indexOf(/\/items\//) != -1 && !Zotero.URI.getURIItem(uri)) {
|
}
|
||||||
this.eraseByURI(uri);
|
if (uri.indexOf(/\/items\//) != -1 && !Zotero.URI.getURIItem(uri)) {
|
||||||
}
|
this.eraseByURI(uri);
|
||||||
if (uri.indexOf(/\/collections\//) != -1 && !Zotero.URI.getURICollection(uri)) {
|
}
|
||||||
this.eraseByURI(uri);
|
if (uri.indexOf(/\/collections\//) != -1 && !Zotero.URI.getURICollection(uri)) {
|
||||||
|
this.eraseByURI(uri);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Zotero.DB.commitTransaction();
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
Zotero.debug(e);
|
||||||
|
Zotero.debug(Zotero.DB.query("SELECT * FROM relations"));
|
||||||
}
|
}
|
||||||
Zotero.DB.commitTransaction();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user