Zotero changes the actual citation

Sometimes I amend the citation in word, and then accept changes. This change in formatting is often lost even though I accept changes (this has been noted on the forum before). More worrying is that sometimes Zotero changes the citation altogether. I've caught it doing this a number of times, most recently from an 1894 paper to a 2015 paper by completely different authors. I don't know why it does this. Very concerning.
  • edited June 6, 2018
    Are you manually typing changes to citations into Word, or are you editing the item in your Zotero library and/or using the prefix/suffix fields in the Add/Edit Citation window? You should always be using the latter for the smoothest experience working with Zotero: https://zotero.org/support/word_processor_plugin_usage#customizing_cites

    Zotero wouldn't ever change the citation to a different item. What likely happened there, was that you or a coauthor moved citations around during your edits.
  • Thank you bwiernik. What is wrong with moving around citations during edits?
  • edited June 6, 2018
    The most likely case of what happened is that, say you deleted a bunch of text, but kept the parenthesis from one citation and the rest of the text from another citation. In that case, Zotero will see those as two separate citations (because it relies on hidden text underneath the visible citations to format them). You or a coauthor might also have changed the citation text without changing the underlying reference (e.g., if the citation was originally to the 2015 paper but then someone just changed the inner text to refer to the 1894 paper, rather than replacing the citation with Zotero). In that case, Zotero has no way of knowing that you changed the reference and still thinks it should be to the 2015 paper.

    Generally, the procedure you want to follow is to be sure that you always delete a reference's text in its entirety if you want to delete a citation and to use Zotero for all edits to the citations (e.g., to replace a citation with one to a different paper, to add page numbers or "e.g.,", etc., or to correct mispelled author names). If you move a citation from one spot in the document to another, be sure that you grab all of the text (parentheses and all) as you go.
  • Thank you bwiernik. Really appreciate it. I don't know if this explains my recent substitution (complete substitution, no text amendment). But I'll be careful to watch out going forward! Thanks again.
  • Yeah, I can't really imagine how else that might have happened, but I wouldn't worry too much about it—I've never heard of such a thing before and don't think it will happen again.
  • I have to admit it has happened again. I added a citation and it changed the next citation underneath it. I didn't do anything or move anything around, apart from simply adding the citation a paragraph up. Changed a 1997 article for the new 2007 article even though my cursor etc. and everything being changed only a paragraph up. Very disconcerting.
  • If you type Alt + F9, do the codes for the changed item that appear match the original or new item? What if you check before inserting the item that caused the change?

    Besides the bibliographic data shown, look specifically at the “id” data in the code. Does that change?

    If the item codes have changed, can you submit a Debug Log from the Zotero Help menu for an attempt to insert a citation that causes this change?
  • Thanks ever so much for this bwiernik. Yes, the id is being changed.

    I've just caught it doing it again. What happens is I try to insert a citation, and it fails for some unknown reason, and I get the following error report:

    "Zotero experienced an error updating your document.

    Document modified during update @[setCode:field.m:660]"

    I thought this just meant the insertion of the new citation failed. What I hadn't realised it at the time, but what this appears to mean, is that Zotero updates the next citation in the document to the citation which I was trying to insert (although no citation is inserted at the intended location). Plus there is no moving of the cursor etc. so you think nothing has happened and just try again (and the second time the citation is always inserted as normal).

    This is a fairly rare occurrence, but I'd estimate has happened 5-7 times in this document, so now I need to go back through and check all my citations!

    Yes, will submit a Debug Log.
  • Report ID: 1773948291
  • That’s a Report ID. I meant a Debug Log ID. Enable Debug Logging by clicking Help - Debug Output Logging - Enable.

    Then perform the action that produces this behavior. Afterwards, go back to the Help menu and click Submit Log.

    That error though, indicates what I think the problem is. Zotero can get tripped up if you move the next a citation is part of while Zotero is updating it. You may have some corrupt citation in your document. I recommend you follow Step 8 here:
    https://www.zotero.org/support/word_processor_plugin_troubleshooting#debugging_broken_documents

    to find the corrupt citations and re-insert them.

    @adomasven I’ve never seen behavior like this before. Any other ideas?
  • Thanks ever so much for all the help. I will try and track down any corrupt citations. And will log and submit next time it happens. In the meantime, this is my current log that appears to have at least 2 instances:


    [JavaScript Error: "NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXPCComponents_Utils.import]" {file: "resource://services-common/kinto-http-client.js" line: 61}]

    [JavaScript Error: "Discarding invalid field 'publisher' for type 4 for item 1/null"]

    [JavaScript Error: "Discarding invalid field 'institution' for type 4 for item 1/null"]

    [JavaScript Error: "Discarding invalid field 'company' for type 4 for item 1/null"]

    [JavaScript Error: "Discarding invalid field 'label' for type 4 for item 1/null"]

    [JavaScript Error: "Discarding invalid field 'distributor' for type 4 for item 1/null"]

    [JavaScript Error: "Discarding invalid field 'publisher' for type 4 for item 1/null"]

    [JavaScript Error: "Discarding invalid field 'publisher' for type 4 for item 1/null"]

    [JavaScript Error: "Document modified during update @[setCode:field.m:660]" {file: "file:///Applications/Zotero.app/Contents/Resources/extensions/zoteroMacWordIntegration@zotero.org/components/zoteroMacWordIntegration.js" line: 213}]

    [JavaScript Error: "The connection to wss://stream.zotero.org/ has terminated unexpectedly. Some data may have been transferred." {file: "chrome://zotero/content/xpcom/streamer.js" line: 155}]

    [JavaScript Error: "WebSocket connection closed: 1006 "]

    [JavaScript Error: "The connection to wss://stream.zotero.org/ has terminated unexpectedly. Some data may have been transferred." {file: "chrome://zotero/content/xpcom/streamer.js" line: 155}]

    [JavaScript Error: "WebSocket connection closed: 1006 "]

    [JavaScript Error: "The connection to wss://stream.zotero.org/ has terminated unexpectedly. Some data may have been transferred." {file: "chrome://zotero/content/xpcom/streamer.js" line: 155}]

    [JavaScript Error: "WebSocket connection closed: 1006 "]

    [JavaScript Error: "Discarding invalid field 'publisher' for type 4 for item 1/null"]

    [JavaScript Error: "Discarding invalid field 'publisher' for type 4 for item 1/null"]

    [JavaScript Error: "Document modified during update @[setCode:field.m:660]" {file: "file:///Applications/Zotero.app/Contents/Resources/extensions/zoteroMacWordIntegration@zotero.org/components/zoteroMacWordIntegration.js" line: 213}]

    [JavaScript Error: "Discarding invalid field 'publisher' for type 4 for item 1/null"]

    [JavaScript Error: "Discarding unknown JSON field '_eprint' for item 1/null"]

    [JavaScript Error: "Discarding invalid field 'bookTitle' for type 4 for item 1/null"]

    [JavaScript Error: "Discarding invalid field 'publisher' for type 4 for item 1/null"]

    [JavaScript Error: "The connection to wss://stream.zotero.org/ has terminated unexpectedly. Some data may have been transferred." {file: "chrome://zotero/content/xpcom/streamer.js" line: 155}]

    [JavaScript Error: "WebSocket connection closed: 1006 "]

    [JavaScript Error: "Discarding invalid field 'pages' for type 2 for item 1/null"]

    version => 5.0.47, platform => MacIntel, oscpu => Intel Mac OS X 10.13, locale => en-US, appName => Zotero, appVersion => 5.0.47, extensions => Zotero Word for Mac Integration (5.0.15.SA.5.0.47, extension), Zotero LibreOffice Integration (5.0.13.SA.5.0.47, extension)
  • Hi, something similar (but different) happened today. I added a citation (Fried, 1973). Zotero then cleaned up a reference to Ono & Comerford (1977), but in doing so deleted a different reference that was earlier in the paragraph, before Fried, 1973 and Ono & Comerford (1977), namely Wallach & Zuckerman (1963). This is the output:

    (4)(+0000034): ZoteroMacWordIntegration: setText rtf:false (Fried, 1973)

    (4)(+0000080): ZoteroMacWordIntegration: getText (Fried, 1973)

    (4)(+0000000): ZoteroMacWordIntegration: setCode ITEM CSL_CITATION {"citationID":"qmk7ZuBj","properties":{"formattedCitation":"(Fried, 1973)","plainCitation":"(Fried, 1973)","noteIndex":0},"citationItems":[{"id":535,"uris":["http://zotero.org/users/local/X7lXZXC9/items/9L5IMWTF"],"uri":["http://zotero.org/users/local/X7lXZXC9/items/9L5IMWTF"],"itemData":{"id":535,"type":"thesis","title":"Convergence as a cue to distance","publisher":"New School of Social Research","publisher-place":"New York","genre":"PhD Dissertation","event-place":"New York","author":[{"family":"Fried","given":"A. H."}],"issued":{"date-parts":[["1973"]]}}}],"schema":"https://github.com/citation-style-language/schema/raw/master/csl-citation.json"}

    (4)(+0000052): ZoteroMacWordIntegration: getText Ono & Comerford (1977)

    (3)(+0000000): [_updateDocument] Attempting to update manually modified citation. Original: (H. Ono & Comerford, 1977) Current: Ono & Comerford (1977)

    (4)(+0000000): ZoteroMacWordIntegration: select

    (4)(+0000030): ZoteroMacWordIntegration: displayAlert

    (4)(+0003426): ZoteroMacWordIntegration: setCode ITEM CSL_CITATION {"citationID":"1fpOP1jL","properties":{"formattedCitation":"(H. Ono & Comerford, 1977)","plainCitation":"(H. Ono & Comerford, 1977)","dontUpdate":true,"noteIndex":0},"citationItems":[{"id":532,"uris":["http://zotero.org/users/local/X7lXZXC9/items/RSMWEMSI"],"uri":["http://zotero.org/users/local/X7lXZXC9/items/RSMWEMSI"],"itemData":{"id":532,"type":"chapter","title":"Stereoscopic depth constancy","container-title":"Stability and constancy in visual perception: Mechanisms and process","publisher":"Wiley","publisher-place":"New York","event-place":"New York","author":[{"family":"Ono","given":"H."},{"family":"Comerford","given":"J."}],"container-author":[{"family":"Epstein","given":"W."}],"issued":{"date-parts":[["1977"]]}}}],"schema":"https://github.com/citation-style-language/schema/raw/master/csl-citation.json"}

    (4)(+0000164): ZoteroMacWordIntegration: delete

    (3)(+0000036): Integration: updateDocument complete in -2.974s

    (4)(+0000002): ZoteroMacWordIntegration: setDocumentData

    (3)(+0000012): Integration: MacWord16-addEditCitation:'/Applications/Microsoft Word.app/' complete in 9.48s

    (4)(+0000000): ZoteroMacWordIntegration: cleanup

    (4)(+0000042): ZoteroMacWordIntegration: activate

    (4)(+0000000): ZoteroMacWordIntegration: complete
  • Just happened again, this is the output. Thanks again:


    [JavaScript Error: "NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXPCComponents_Utils.import]" {file: "resource://services-common/kinto-http-client.js" line: 61}]

    [JavaScript Error: "The connection to wss://stream.zotero.org/ has terminated unexpectedly. Some data may have been transferred." {file: "chrome://zotero/content/xpcom/streamer.js" line: 155}]

    [JavaScript Error: "WebSocket connection closed: 1006 "]

    [JavaScript Error: "Discarding invalid field 'publisher' for type 4 for item 1/null"]

    [JavaScript Error: "The connection to wss://stream.zotero.org/ has terminated unexpectedly. Some data may have been transferred." {file: "chrome://zotero/content/xpcom/streamer.js" line: 155}]

    [JavaScript Error: "WebSocket connection closed: 1006 "]

    [JavaScript Error: "The connection to wss://stream.zotero.org/ has terminated unexpectedly. Some data may have been transferred." {file: "chrome://zotero/content/xpcom/streamer.js" line: 155}]

    [JavaScript Error: "WebSocket connection closed: 1006 "]

    [JavaScript Error: "The connection to wss://stream.zotero.org/ has terminated unexpectedly. Some data may have been transferred." {file: "chrome://zotero/content/xpcom/streamer.js" line: 155}]

    [JavaScript Error: "WebSocket connection closed: 1006 "]

    [JavaScript Error: "The connection to wss://stream.zotero.org/ has terminated unexpectedly. Some data may have been transferred." {file: "chrome://zotero/content/xpcom/streamer.js" line: 155}]

    [JavaScript Error: "WebSocket connection closed: 1006 "]

    [JavaScript Error: "Discarding invalid field 'publisher' for type 4 for item 1/null"]

    [JavaScript Error: "Discarding invalid field 'publisher' for type 4 for item 1/null"]

    [JavaScript Error: "Discarding invalid field 'publisher' for type 4 for item 1/null"]

    [JavaScript Error: "The connection to wss://stream.zotero.org/ has terminated unexpectedly. Some data may have been transferred." {file: "chrome://zotero/content/xpcom/streamer.js" line: 155}]

    [JavaScript Error: "WebSocket connection closed: 1006 "]

    [JavaScript Error: "The connection to wss://stream.zotero.org/ has terminated unexpectedly. Some data may have been transferred." {file: "chrome://zotero/content/xpcom/streamer.js" line: 155}]

    [JavaScript Error: "WebSocket connection closed: 1006 "]

    [JavaScript Error: "The connection to wss://stream.zotero.org/ has terminated unexpectedly. Some data may have been transferred." {file: "chrome://zotero/content/xpcom/streamer.js" line: 155}]

    [JavaScript Error: "WebSocket connection closed: 1006 "]

    [JavaScript Error: "NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXPCComponents_Utils.import]" {file: "resource://services-common/kinto-http-client.js" line: 61}]

    [JavaScript Error: "Discarding invalid field 'publisher' for type 4 for item 1/null"]

    [JavaScript Error: "Document modified during update @[setCode:field.m:660]" {file: "file:///Applications/Zotero.app/Contents/Resources/extensions/zoteroMacWordIntegration@zotero.org/components/zoteroMacWordIntegration.js" line: 213}]

    version => 5.0.48, platform => MacIntel, oscpu => Intel Mac OS X 10.13, locale => en-US, appName => Zotero, appVersion => 5.0.48, extensions => Zotero Word for Mac Integration (5.0.15.SA.5.0.48, extension), Zotero LibreOffice Integration (5.0.14.SA.5.0.48, extension)

    (3)(+0000000): Last backup of database 'zotero' was less than 1440 minutes ago -- skipping backup

    (4)(+0004988): SELECT itemID FROM items JOIN deletedItems USING (itemID) WHERE libraryID=? AND dateDeleted<=DATE('NOW', '-30 DAYS') [1]


  • @dstillman @adomasven Do you have any idea why he might be getting the “Document modified during update” error consistently?
  • @PaulLC if you are still looking for a solution, you will need to run through the debugging broken documents steps. This sounds like a case of highly corrupt document. We have never had reports of anything similar and it would require for Word itself to be confused about where which citations are in your document and report them wrong to Zotero.
  • Thank you, very much appreciated!
Sign In or Register to comment.