Wikipedia Citation Templates error (ID: 1890132674)

I have a situation where some citations export (via quick copy) to wikipedia template without problems while some others give Javascript Error: An error occurred while trying to export the selected file. Z 2.1.1, FF 4, Ubuntu 10.04

Report id: 1890132674
  • TypeError: item.creators[i] is undefined
  • edited March 30, 2011
    This should not be the reason, as I have editors marked there. Does this mean that books that have only editor are excluded from the wikipedia templates? Seems not. But the same thing also happens with at least two citations that are book sections with author and editors. Maybe there is something wrong (but I can't see what) with the items themselves?

    I looked at it and it appears that if translator or editor is marked in zotero fields before the author, the javascript error is displayed.
  • That wasn't for you. It was for whoever ends up looking into this.
  • Please go to http://github.com/ajlyon/zotero-bits/raw/master/Wikipedia Citation Templates.js and save the file to the translators directory of your Zotero data directory (http://www.zotero.org/support/zotero_data).

    It should start working again. If this works for you, please post here so that I can submit this change to be pushed to all users.
  • And thanks for teasing out the conditions that cause this-- it made finding the bug quite easy.
  • Thanks. The new Wikipedia Citation Templates.js file works and I get no error when exporting the citation. Still there appears to be some confusion how to match the fields. When no author is present the first "contributor" is now marked as author (| last = Name | first = Name) and subsequent contributors are marked as _coauthors_. Probably the best solution would be to list them as "others" or omit the contributors altogether. The editor is currently marked as "others", but wikipedia template supports "editor" field also.
  • 1. There's a note in the exporter that reads: "as per docs, use editor only for chapters". Is this not correct? The code currently uses editor only for book sections, conference papers (proceedings), and encyclopedia articles.

    2. The current code is careful to make sure that there is always a primary author. Is that out of sync with what Wikipedia templates want?

    3. Creators with the explicit type "contributor" are currently omitted.
  • 1/2) As I'm not very familiar with the wikipedia guidelines about citations I'm not sure. I was in a sense following the Chicago style.

    3) Actually, seems that is not the case. I have a book thats a compilation of different contributors and one editor. The citation should display editor only. But I have some contributors listed as authors, what should not happen.

    From Wikipedia template (http://en.wikipedia.org/wiki/Template:Cite_book):

    editor: Name of editor/editors. Do not Wikilink any values in the editor field but use editor-link instead. The template automatically adds "ed." after the editor's name unless the chapter parameter is used in which case the template adds "in" before the editor's name which appears after the chapter and before the title. This implies that the author is responsible only for part of the book (including the cited chapter) and the editor responsible for the whole book. If, however, the author(s) and editor(s) are responsible for the whole book, then the editor field or its alternates described below should not be used if the chapter field is being used. Instead, the editor(s) should be included in an author field with possibly "(ed.)" after the surname(s). Alternatively, the editor field may be used if the chapter detail is included in the title field instead of using the chapter field.
  • This seems like a real mess. I may get back to this at a later date, but I feel like the Wikipedia citation folks need to get their house in order before we bend over backwards to support the details of this. Maybe someone can convince them to allow a standard format of some sort.
Sign In or Register to comment.