Report ID 1635808036

I am trying to use the Environment and Urbanisation style but the document reports an error. I would be grateful for any support
  • How about in a new, empty document -- same problem?
  • I opened a new document as suggested. Added a reference and chose the Env and Urban stlye. It gace the style with wrong format. But also then did not let me change my document properties (style) and kept giving me an error.
  • [JavaScript Error: "this.betterbase.givens[this.gnameset] is undefined" {file: "chrome://zotero/content/xpcom/citeproc.js" line: 17634}]
    @fbennett: This would be with 1.2.2.
  • edited June 18, 2019
    @pranabm1: Possibly you did not do the second trial in an empty document? This is a bug, but if you insert a single reference in an empty document, there should be no error (and I don't get one here). The best I could do was to trigger it with a combination of three references.

    @dstillman, @adamsmith: There are some issues here. The preview on zotero.org/styles is also broken, and as far as I can tell it has been since the style was first released. (I ran a test over the style using the processor code in use when it was first checked in [January 2016], and it crashed there as well).

    I've added a fix for the crashing error, but the style applies an odd disambiguation pattern that the processor cannot (and will not) handle. The pattern boils down to this:
    <if position="subsequent">
    <group delimiter=", ">
    <text prefix="See reference " variable="first-reference-note-number"/>
    <choose>
    <if disambiguate="true">
    <text macro="contributors-short"/>
    </if>
    </choose>
    <choose>
    <if disambiguate="true">
    <text variable="title"/>
    </if>
    </choose>
    </group>
    </if>


    The crash was triggered by the second disambiguate="true" conditional (for some reason that I haven't taken the trouble to pinpoint), but the underlying cause was the call to the contributors-short macro within the scope of the first condition. That call raises issues that I won't attempt to work around.

    The processor applies disambiguation rules in sequence until a set of references either resolve or fail to disambiguate, as per the CSL Specification. The sequence is:
    1. Show more names
    2. Expand names (adding initials or full given names)
    3. Add a year-suffix
    4. Render the cite with the disambiguate attribute of cs:choose conditions testing “true”
    The processor does not follow these rules precisely, but disambiguate conditions are applied after adding and expanding names. Therefore, at the stage where the disambiguate condition is triggered, there are no further name operations to be performed, and as a result, adding and expanding names beyond the baseline requirements of the et-al-min and et-al-use-first attributes will never occur in this style. It's a limitation of the CSL logic that actually makes pretty good sense.

    While the style does need some form of disambiguation to function correctly, the style guide does not give any guidance on the rules that should be applied, so it looks like there should be leeway to just adjust the code of the style to avoid the chicken-and-egg problem described above.
  • I'm not sure I follow 100% -- what the style would seem to _try_ to do is
    1. Print the first reference note number
    2. If that's ambiguous, add the short author names
    3. If those are ambiguous, add the title

    Am I understanding correctly that that the two consecutive disambiguate tests would be fine, but the problem is that the contributors-short macro is also subject to "disambiguate-add-names", which would typically precede the test in which it is embedded, thus causing havoc?

    Are you asking for advice on what citeproc-js should do here? I think ideally it would not apply other disambiguation inside if-disambiguate="true", but any other clear-cut solution is fine, too.

  • That was just explaining why disambiguate-add-names is redundant there -- there isn't any havoc, it just won't do anything. I don't plan to make any changes apart from the crash fix.

This is an old discussion that has not been active in a long time. Before commenting here, you should strongly consider starting a new discussion instead. If you think the content of this discussion is still relevant, you can link to it from your new discussion.

Sign In or Register to comment.