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.
  • Make sure that running a refresh, or changing a citation style in c.2 works. Just attempting those might produce an error message that will hint at the broken citation. Otherwise see debugging broken documents instructions. If you isolate a single offending citation, please do email it to support@zotero.org with a link to this thread.
  • Thank you for your reply.

    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.
  • Could you send those two paragraphs in to support@zotero.org with a link to this thread.

    Otherwise, does reinserting the citations in those paragraphs and then combining chapters fix the issue?
  • I just sent the paragraphs.

    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.
  • Could you also submit a Debug ID for an operation that causes issues?
  • Ok, sorry this took a while to look into.

    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.
  • @adomasven given that some disciplines have footnotes spanning half a page with dozens of references, I don't think this works. Obviously what you say is correct for a standard FN that's just a citaiton and a little text, but Zotero has to be able to insert citations into manually created footnotes and this has never come up as an issue before (and I'm pretty sure lots of people do this).
  • edited August 23, 2017
    There is a difference between using a footnote based style and adding comments, and inserting inline references into footnotes inserted by the word processor. The latter being fully supported and the former having unspecified behaviour.

    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.
  • Ah OK, I had misunderstood this as being about the 2nd scenario. I'm fine with the first one not working; thanks for clarifying.
Sign In or Register to comment.