commit 4d1081be1a9f6a53435a210642ee71cefa0d643b parent 03826c4254fb5e39a865951cced0367e52385af4 Author: Dan Stillman <dstillman@zotero.org> Date: Sat, 21 Feb 2009 22:13:57 +0000 Fix FK constraint error with tags, often after the tag conflict window Diffstat:
| M | chrome/content/zotero/xpcom/data/tag.js | | | 8 | +++++--- |
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/chrome/content/zotero/xpcom/data/tag.js b/chrome/content/zotero/xpcom/data/tag.js @@ -221,11 +221,11 @@ Zotero.Tag.prototype.save = function (full) { } if (this.type != 0 && this.type != 1) { - throw ('Invalid tag type ' + this.type + ' in Zotero.Tag.save()'); + throw ('Invalid tag type ' + this.type + ' for tag ' + this.id + ' in Zotero.Tag.save()'); } if (!this.name) { - throw ('Tag name is empty in Zotero.Tag.save()'); + throw ('Tag ' + this.id + ' name is empty in Zotero.Tag.save()'); } if (!this._changed) { @@ -590,7 +590,9 @@ Zotero.Tag.prototype._setLinkedItems = function (itemIDs) { if (currentIDs.indexOf(id) != -1) { Zotero.debug("Item " + itemIDs[i] + " is already linked to tag " + this.id); - oldIDs.push(id); + if (oldIDs.indexOf(id) == -1) { + oldIDs.push(id); + } continue; }