Error [MLZ] citation processor only works second time

I am using MLZ and Australian Guide to Legal Citation. Each time I enter a citation in Word using the classic citation dialog, it returns the error 'Zotero experienced an error in updating your document. this.registry.registry[myid] is undefined'. However, the second time I can successfully insert the citation.

I have tried converting the document into MLZ New Zealand style and also copying and pasting into a new document. The error is occurring across computers with different browsers/Word versions, too. Any ideas as to what I can do - I'm writing a long document and although I can get the documents in, it's pretty frustrating.
  • I may already have a fix for this in the processor, thanks to a bug report from another developer. I'll put up a fresh MLZ release within the next couple of hours that may make the problem go away.
  • Okay, try updating MLZ (the update should give you version 4.0.21m472).

    I'm not 100% certain that this has the same cause as the other error. If it's still not working smoothly, post back and I'll dig into it further.
  • Thanks so much for your quick response - I'm afraid I didn't get around to properly testing this but it seems the problem is still happening (it seems to work for a bit, then when the inserting citations continues, it starts again).
  • edited September 9, 2014
    Okay, let's look more closely. You are the only one to report the problem, so it's likely something to do with your document or particular setup.

    First, just to be sure, you don't have the patch plugin installed, by any chance? (It shows up as "Citation Gadget", I think.) If it is installed, disable or remove it, and the problem should go away.

    If the patch plugin is not installed, is this happening with one document only, or does it happen in a freshly created document as well?

    In a document that shows the problem, do you also get failures with the New Zealand style, or does it fail only when the AGLC is selected?

    Once those answers are in, we can start narrowing things down and get this fixed for you.
  • I have the same problem with it in NZ law style. Sometimes it happens in some paragraphs but not in others. However, when it occurs, if I try to re-insert the same citation again to alter the same citation again, there is no problem the second time.
  • Rogena,

    To confirm, you are seeing this error?
    this.registry.registry[myid] is undefined
    If so, I'll need to reproduce the problem in order to find and fix the bug. If you notice a pattern to the failure, please post again.
  • Yes that is the error, it happens in some documents and not in others.

    The interesting thing is if you repeat inserting the same citation, the second time, this error does not occur.

    If you have any ideas let me know.

  • Can you predict when the failure will happen? That is, in failing documents, does every first insert attempt fail, or all inserts if a particular type of citation? Reproducibility is key for getting it fixed.
  • Unfortunately, I don't know what causes it to start, this is what bugs me. It seems that some times when I am copying a section from one document to another, it seems to 'infect' and from then on, literally every citation has to be done twice. The first time the error comes up, and then re-inserting it, it is ok.

    If I find any further information, I will let you know.
  • That's actually good news, from a debugging standpoint: if you have a document that is "reliably failing," we can use it to get at the cause.

    It must be triggered by data that is sent to the processor from the document. By following the steps here, you should be able to narrow down to a minimal document that reproduces the failure. Once you have that, we'll be closer to a fix.
  • I have been experiencing the exact same problem using MLZ. I updated MLZ to the latest version today (4.0.21m482), and reinstalled the Word integration plug-in, to no avail. I also tried switching bibliography styles. I also tried isolating a part of my document that would cause the problem, using the instructions provided by Fbennett above, but the error keeps re-occurring.

    As joycekwc mentioned it, it occurs once every two times. When I first open my document and add a new footnote, the error appears. When I repeat this same step a second time, it works correctly. Then, if I move to a new part of the document, and try to add a new citation, the error appears again (and so on.).

    In the error report, this shows up at some point, several times in a row:
    [JavaScript Error: "this.registry.registry[myid] is undefined" {file: "chrome://zotero/content/xpcom/citeproc.js" line: 4182}].
  • Does this happen in a new document, or only in a document that is once affected?

    If the latter, as the document is split by halves, do you end with a document containing a single reference that shows the error? If the document is split again to contain no references at all, does it still show the error?

    I'm sorry to be responding with further questions; there is clearly an issue, but I need to reproduce the error locally in order to trace the cause.
  • Jumping back into this forum - this is still happening to me on the odd occasion, but not with enough regularity that I can reproduce it or figure it out. It seems to be an issue with longer Word documents, too.
  • I'll follow the issue until we figure out what is causing it, but until I can reproduce it, there isn't much I can do.
  • Hey fbennett, did you have any success on this issue? Im a colleauge of Rogena's and we are both dealing with large documents, 70,000 words+, would that affect things? Perhaps if you create a really large document, instead of a blank one the problem will recur?
  • edited April 1, 2015
    I wasn't able to reproduce the error by guesswork locally. Although it seems clear there is an issue triggered by the New Zealand Law style, I'm unlikely to be able to trace it down without a set of steps to reproduce it.

    The sheer size of the document will not make any difference by itself. As I wrote above in response to Rogena, and again in response to joycekwc, the path to pinning down the problem will lie in the steps for debugging broken documents. If you can follow those steps to find a smaller document fragment that triggers the fault, or to identify the specific conditions that trigger it, the prospects for fixing it will be better.

    Looking at the MLZ-specific features of the style, one possible cause looks to be parallel citations. If you have parallel citations in the document, that would be one thing to watch during splitting trials.
  • I dont think its parallel citations, I input my citations manually and dont refer to the same citation by different names, if thats what you mean.

    I copied an pasted my entire document into a fresh word doc and it worked fine for two or three citations then failed. A fresh doc with only half a dozen pages failed after the third attempt with the same citation.

    I opened a fresh document and noticed that when I used different citations each time there was no problem, but when I used the same citation more than twice it failed.

    Testing different citations and some prompt failure when used consecutively and some dont. In general once I start working every citation fails.

    Opened a fresh doc and used Chicago style instead of NZ Law and it worked fine. A new doc using NZ Law failed, so its definitely something about the MLZ plugin. Who would I notify about that?

    I can work with this problem, and have been doing so for some time, but its pretty frustrating...
  • When I used the same citation more than twice it failed.
    So if I open a fresh (empty) document, set it to MLZ New Zealand Law style, and enter the same citation several times in a row, I should see the failure?

    (Sorry to keep responding with questions, but until we pin down the exact steps for reproducing the problem, it's hard for me to get started.)
  • Thats what has been happening to me, but not with every citation in a fresh document. It seemed to happen with longer citations, or maybe its that the particular citation was a Treaty item, or some other reason. It happened on the third time, if it was going to happen. With my current working document it happens every time, and also when I try and edit citations.

    And no problem, Im glad someone else is having a go at this one, we are recommending that all the law PhDs start using Zotero and its important that things like this dont bother everyone.
  • fbennett (who writes MLZ, so he's your guy for actual troubleshooting) will want an item with which you can reliably reproduce that in a fresh document.
    If you have an item for which that's the case, export is as bibliontology RDF (right-click-->Export). Then open the file with a text editor (TextEdit, Notepad), select all and copy. The paste the entire content to --> Create Public Gist (bottom of the screen) and provide a link here.

    Again, make sure that, with the item you're exporting, if you insert that one citation several times in a row, you get an error.

    You need to put fbennett in a position so that he can generate that error on his own machine--then he'll likely be able to fix it quickly.
  • Hi there,

    I am experiencing this problem on a document ~9000 words long, using Juris-M NZ Law Style. The same thing occurs that the citation always works the second time around, and happens seemingly randomly.

    Was there a solution?
  • The reports of this seem to cluster around the NZ Law Style. When the error occurs, could you check with Shift-Ctrl-j (Shift-Cmd-j on a Mac) and see if there are any suspicious errors listed (say, in red).
  • The following errors come up in red:

    TypeError: AbbrevsFilter.initWindow is not a function

    TypeError: this._editor is undefined styled-textbox.xml:217:9 (with a red 5 next to it)
    this.registry.registry[myid] is undefined citeproc.js:4336:0

    TypeError: History.getState is not a function _zoterowwwAll.bugly.1435774747.js:4478:20
  • Thanks very much for investigating. The registry error is one I've wanted to zone in on for quite awhile. If you are able to reproduce it, we should be able to squash it.

    I'll try to get a debugging version out tomorrow. I'll post back here when it's ready.
  • @haleennah,

    One question before I look further. Do you have the Abbreviation Filter plugin installed? If so, what is its version number?
  • I have version 1.1.18 :)
  • Okay. I think I've found a relevant bug in the processor code (unrelated to the Abbreviation Filter). It would be triggered by styles that use "first-reference-note-number," which is true of the New Zealand Law style.

    I've fixed the bug in the processor. To try it out, install the latest release of the Processor Patch plugin. You should remove the plugin at the next Juris-M release.
Sign In or Register to comment.