- Zotero.Translate.Import#getTranslators should return translators when they are available
- Add deprecation warning for select handler without a callback
This commit is contained in:
parent
4d307c1865
commit
3238656ca0
1 changed files with 5 additions and 1 deletions
|
@ -425,6 +425,10 @@ Zotero.Translate.Sandbox = {
|
||||||
var returnValue = translate._runHandler("select", items, newCallback);
|
var returnValue = translate._runHandler("select", items, newCallback);
|
||||||
if(returnValue !== undefined) {
|
if(returnValue !== undefined) {
|
||||||
// handler may have returned a value, which makes callback unnecessary
|
// 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;
|
returnedItems = returnValue;
|
||||||
haveAsyncHandler = false;
|
haveAsyncHandler = false;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1520,7 +1524,7 @@ Zotero.Translate.Import.prototype.getTranslators = function() {
|
||||||
});
|
});
|
||||||
if(this._currentState === null) return this._foundTranslators;
|
if(this._currentState === null) return this._foundTranslators;
|
||||||
} else {
|
} else {
|
||||||
Zotero.Translate.Base.prototype.getTranslators.call(this);
|
return Zotero.Translate.Base.prototype.getTranslators.call(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue