Merge pull request #237 from aurimasv/web-title

Consider type-specific "title" alternatives for validating web translations
This commit is contained in:
Simon Kornblith 2013-02-06 18:12:30 -08:00
commit 548a6db761

View file

@ -578,6 +578,10 @@ Zotero.Translate.Sandbox = {
item.accessDate = "CURRENT_TIMESTAMP";
}
//consider type-specific "title" alternatives
var altTitle = Zotero.ItemFields.getName(Zotero.ItemFields.getFieldIDFromTypeAndBase(item.itemType, 'title'));
if(altTitle && item[altTitle]) item.title = item[altTitle];
if(!item.title) {
translate.complete(false, new Error("No title specified for item"));
return;