From 3238656ca0971d09e0a9c6712c348d1dfd3d65f3 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Tue, 12 Jul 2011 04:34:06 +0000 Subject: [PATCH] - Zotero.Translate.Import#getTranslators should return translators when they are available - Add deprecation warning for select handler without a callback --- chrome/content/zotero/xpcom/translation/translate.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index b24644adf0..9785668e93 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -425,6 +425,10 @@ Zotero.Translate.Sandbox = { var returnValue = translate._runHandler("select", items, newCallback); if(returnValue !== undefined) { // handler may have returned a value, which makes callback unnecessary + Zotero.debug("WARNING: Returning items from a select handler is deprecated. "+ + "Please pass items as to the callback provided as the third argument to "+ + "the handler."); + returnedItems = returnValue; haveAsyncHandler = false; } else { @@ -1520,7 +1524,7 @@ Zotero.Translate.Import.prototype.getTranslators = function() { }); if(this._currentState === null) return this._foundTranslators; } else { - Zotero.Translate.Base.prototype.getTranslators.call(this); + return Zotero.Translate.Base.prototype.getTranslators.call(this); } }