Ticket #1770: citations-undefined.patch

File citations-undefined.patch, 1.4 KB (added by fbennett, 6 years ago)
  • chrome/content/zotero/xpcom/integration.js

     
    13711371                        citation.citationID = Zotero.randomString(); 
    13721372                } 
    13731373                this.newIndices[index] = true; 
    1374                 this.updateIndices[index] = true; 
     1374                // Adding a citation, so newIndices flag does the trick. 
     1375                // Flagging in updateIndices as well causes processor crash. 
     1376                //this.updateIndices[index] = true; 
    13751377        } 
    13761378        Zotero.debug("Zotero.Integration: adding citationID "+citation.citationID); 
    13771379        this.citationIDs[citation.citationID] = true; 
     
    15441546        if(regenerateAll || this.regenerateAll) { 
    15451547                // update all indices 
    15461548                for(var i=0; i<this.citationsByIndex.length; i++) { 
    1547                         this.newIndices[i] = true; 
    15481549                        this.updateIndices[i] = true; 
     1550                        if (this.newIndices[i]) { 
     1551                                delete this.newIndices[i]; 
     1552                        } 
    15491553                } 
    15501554        } else { 
    15511555                // update only item IDs 
     
    16651669 */ 
    16661670Zotero.Integration.Session.prototype.restoreProcessorState = function() { 
    16671671        var citations = []; 
    1668         for(var i in this.citationsByIndex.length) { 
    1669                 if(this.citationsByIndex[i] && !this.newIndices[i] && !this.citationsByIndex[i].properties.delete) { 
     1672        for(var i in this.citationsByIndex) { 
     1673                if(this.citationsByIndex[i] && !this.citationsByIndex[i].properties.delete) { 
    16701674                        citations.push(this.citationsByIndex[i]); 
    16711675                } 
    16721676        }