Fix errors adding tags with leading or trailing spaces to items (since yesterday)
This commit is contained in:
parent
7a6656ae5c
commit
6a20d690e0
1 changed files with 4 additions and 0 deletions
|
@ -2689,6 +2689,8 @@ Zotero.Item.prototype.addTag = function(name, type) {
|
|||
throw ('Cannot add tag to unsaved item in Item.addTag()');
|
||||
}
|
||||
|
||||
name = Zotero.Utilities.prototype.trim(name);
|
||||
|
||||
if (!name) {
|
||||
Zotero.debug('Not saving empty tag in Item.addTag()', 2);
|
||||
return false;
|
||||
|
@ -2836,6 +2838,8 @@ Zotero.Item.prototype.replaceTag = function(oldTagID, newTag) {
|
|||
throw ('Cannot replace tag on unsaved item');
|
||||
}
|
||||
|
||||
newTag = Zotero.Utilities.prototype.trim(newTag);
|
||||
|
||||
if (!newTag) {
|
||||
Zotero.debug('Not replacing with empty tag', 2);
|
||||
return false;
|
||||
|
|
Loading…
Add table
Reference in a new issue