From 1f643c1baae4dbca49277b23c49b4929006b2d37 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 2 Jun 2015 03:28:46 -0400 Subject: [PATCH] Fix skipNotifier option with DataObject::erase() --- .../content/zotero/xpcom/data/collection.js | 2 +- chrome/content/zotero/xpcom/data/item.js | 8 +++- chrome/content/zotero/xpcom/search.js | 2 +- test/tests/dataObjectTest.js | 38 +++++++++++++++++++ 4 files changed, 46 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/collection.js b/chrome/content/zotero/xpcom/data/collection.js index 8137e24eb..912c29026 100644 --- a/chrome/content/zotero/xpcom/data/collection.js +++ b/chrome/content/zotero/xpcom/data/collection.js @@ -611,7 +611,7 @@ Zotero.Collection.prototype._eraseData = Zotero.Promise.coroutine(function* (env this.ObjectsClass.unload(collections); //return Zotero.Collections.reloadAll(); - if (!env.skipNotifier) { + if (!env.options.skipNotifier) { Zotero.Notifier.queue('delete', 'collection', collections, notifierData); } }); diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index 6c93a1836..9fc4eddbd 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -3762,7 +3762,11 @@ Zotero.Item.prototype._eraseData = Zotero.Promise.coroutine(function* (env) { let toDelete = yield Zotero.DB.columnQueryAsync(sql, [this.id]); for (let i=0; i {}) + + for (let id of observerIDs) { + Zotero.Notifier.unregisterObserver(id); + } + }) + }) + describe("#updateVersion()", function() { it("should update the object version", function* () { for (let type of types) {