From 909b4b31c80dc83fa58c74a1f3e6d692cf4f399f Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 5 Jul 2017 08:52:37 -0400 Subject: [PATCH] Assume import translators updated after today are async See https://github.com/zotero/translators/issues/1353 for details. minVersion is problematic for various reasons, so this is safer. --- chrome/content/zotero/xpcom/translation/translate.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index a17e6112b7..b6047fc9e8 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -81,8 +81,9 @@ Zotero.Translate.Sandbox = { * @param {SandboxItem} An item created using the Zotero.Item class from the sandbox */ _itemDone: function (translate, item) { - var asyncTranslator = translate.translator[0].minVersion - && parseInt(translate.translator[0].minVersion.match(/^[0-9]+/)[0]) >= 5; + // https://github.com/zotero/translators/issues/1353 + var asyncTranslator = translate instanceof Zotero.Translate.Import + && translate.translator[0].lastUpdated > '2017-07-05'; var run = function (resolve) { Zotero.debug("Translate: Saving item"); @@ -205,7 +206,7 @@ Zotero.Translate.Sandbox = { // For synchronous import (when Promise isn't available in the sandbox or the do* // function doesn't use it) and web translators, queue saves - if (!resolve || translate instanceof Zotero.Translate.Web || !asyncTranslator) { + if (!resolve || !asyncTranslator) { Zotero.debug("Translate: Saving via queue"); translate.saveQueue.push(item); if (resolve) {