Fix a tag syncing edge case (which shouldn't be possible with production sync server)
This commit is contained in:
parent
3f28260507
commit
e2ff2c3ab7
1 changed files with 8 additions and 1 deletions
|
@ -4212,8 +4212,15 @@ Zotero.Sync.Server.Data = new function() {
|
|||
function _deleteConflictingTag(syncSession, name, type, libraryID) {
|
||||
var tagID = Zotero.Tags.getID(name, type, libraryID);
|
||||
if (tagID) {
|
||||
Zotero.debug("Deleting conflicting local tag " + tagID);
|
||||
Zotero.debug("Deleting conflicting local '" + name + "' tag " + tagID);
|
||||
var tag = Zotero.Tags.get(tagID);
|
||||
// Tag has already been deleted, which can happen if the server has
|
||||
// two new tags that differ only in case, and one matches a local tag
|
||||
// with a different key, causing that tag to be deleted already.
|
||||
if (!tag) {
|
||||
Zotero.debug("Local tag " + tagID + " doesn't exist");
|
||||
return false;
|
||||
}
|
||||
var linkedItems = tag.getLinkedItems(true);
|
||||
Zotero.Tags.erase(tagID);
|
||||
Zotero.Tags.purge();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue