Message error : citations[(j - 1)].sortedItems.slice(...)[0] is undefined
Hello,
I'm using Zotero 5.0 on Mac with Word 2017.
I'm currently merging in a single document the different chapters of my dissertation. I'm having problems with chapter 1. It's fine by itself. And if I create a document with c.1 followed by c.3, everything works fine. Problems appear as soon as I have a document with c.1 followed by c.2 (which works fine by itself as with other chapters).
Trying to add a a citation or to refresh prompts the following message :
citations[(j - 1)].sortedItems.slice(...)[0] is undefined
Any help would be greatly appreciated.
I'm using Zotero 5.0 on Mac with Word 2017.
I'm currently merging in a single document the different chapters of my dissertation. I'm having problems with chapter 1. It's fine by itself. And if I create a document with c.1 followed by c.3, everything works fine. Problems appear as soon as I have a document with c.1 followed by c.2 (which works fine by itself as with other chapters).
Trying to add a a citation or to refresh prompts the following message :
citations[(j - 1)].sortedItems.slice(...)[0] is undefined
Any help would be greatly appreciated.
Following the debugging instructions, I have isolated two paragraphs in c.1 that, when present, causes the message to appear.
These two paragraphs, in a separate document, can be refreshed, a citation can be added, and the citation style can be changed. These operations can also be performed in my main document without these two paragraphs. But as soon as one of them is inserted, the message appears.
Otherwise, does reinserting the citations in those paragraphs and then combining chapters fix the issue?
I tried reinserting the citations in the error-prompting paragraphs, and then pasted them in the main text. But the problem was the same.
Thanks again for all the help.
It seems that besides Zotero citations in the footnotes you have also added additional text there. This is certainly not intuitive, but that's probably what's causing issues. To properly insert supporting text to a footnote citation, you need to select that citation, press Add/Edit Citation, click on one of the blue citation balloons in the dialog and insert the required text in the "Prefix" and "Suffix". Adding the text before and after the citation manually confuses Zotero and can lead to unexpected and broken results.
Consider this from a technical perspective with a footnote based style:
1. A footnote citation is inserted. Zotero notes which note index it belongs in and the whole footnote is considered a citation (and thus field code).
2. Additional text is inserted in said footnote. Now Zotero still considers that it owns this footnote, however it doesn't. In practice this may not create any issues.
3. In document preferences the citation style is changed to an inline reference one. Zotero tries to convert footnotes with text that does not belong to field codes to inline citations.
What happens to the text in the footnotes? Should it be included in the citation representation? Should it be silently discarded? Moreover, Zotero does not even have access to surrounding text in the footnote and is unaware of its presence, if any.
Edit: Oh, you did say "manually created footnotes". Apologies for unnecessary details. Well, yep, that works fine. This document is using a footnote-based citation style and adding surrounding text.