From 5442e2e8a8635f1de0ea54645a393caacaa898c5 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 15 Apr 2013 22:21:54 -0400 Subject: [PATCH] Fix ZFS purging when switching to WebDAV --- chrome/content/zotero/preferences/preferences_sync.js | 2 +- chrome/content/zotero/xpcom/storage/zfs.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/preferences/preferences_sync.js b/chrome/content/zotero/preferences/preferences_sync.js index 15f1679a9d..8b4263e734 100644 --- a/chrome/content/zotero/preferences/preferences_sync.js +++ b/chrome/content/zotero/preferences/preferences_sync.js @@ -72,7 +72,7 @@ Zotero_Preferences.Sync = { } if (oldProtocol == 'zotero' && protocol == 'webdav') { - var sql = "SELECT COUNT(*) FROM version WHERE schema='storage_zfs'"; + var sql = "SELECT COUNT(*) FROM version WHERE schema LIKE 'storage_zfs%'"; if (Zotero.DB.valueQuery(sql)) { var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService); diff --git a/chrome/content/zotero/xpcom/storage/zfs.js b/chrome/content/zotero/xpcom/storage/zfs.js index cdad1f0307..7ec6513a9c 100644 --- a/chrome/content/zotero/xpcom/storage/zfs.js +++ b/chrome/content/zotero/xpcom/storage/zfs.js @@ -1043,6 +1043,10 @@ Zotero.Sync.Storage.ZFS = (function () { */ obj._purgeDeletedStorageFiles = function () { return Q.fcall(function () { + // Cache the credentials at the root + return self._cacheCredentials(); + }.bind(this)) + then(function () { // If we don't have a user id we've never synced and don't need to bother if (!Zotero.userID) { return false;