Don't save unsynchable tags
This commit is contained in:
parent
4e015ecbe9
commit
b117da88a3
1 changed files with 13 additions and 0 deletions
|
@ -580,6 +580,19 @@ Zotero.Translate.Sandbox = {
|
|||
if(setShortTitle) item.shortTitle = title;
|
||||
}
|
||||
|
||||
// refuse to save very long tags
|
||||
if(item.tags) {
|
||||
for(var i=0; i<item.tags.length; i++) {
|
||||
var tag = item.tags[i];
|
||||
tagString = typeof tag === "string" ? tag :
|
||||
typeof tag === "object" ? (tag.tag || tag.name) : null;
|
||||
if(tagString && tagString.length > 255) {
|
||||
translate._debug("WARNING: Skipping unsynchable tag "+JSON.stringify(tagString));
|
||||
item.tags.splice(i--, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// call super
|
||||
Zotero.Translate.Sandbox.Base._itemDone(translate, item);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue