﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1770	"Refresh triggers ""this._session.style is undefined"" or ""citations is undefined"" error in citeproc-js"	fbennett	simon	"This was reported in the following thread:

http://forums.zotero.org/discussion/10916/word-plugin-error-thissessionstyle-is-undefined/

During testing of the multilingual branch, I came up with a simple document that would reliably reproduce this error when reconnected to Zotero. There turned out to be three layers to the problem. First, I found a loop constraint variable mismatch in citeproc-js (now fixed, in the version shipped with 2.1beta5). Second, the for loop in the Zotero-side restoreProcessorState function was attempting to iterate over an integer rather than a list. Fixing these two problems caused the processor crash to occur immediately, rather than on a second refresh attempt. The third issue was in the updateIndices and newIndices objects on Zotero-side. Citation pointers were being set in both objects during a refresh, leading updateCitations() to attempt to perform a second refresh cycle, which triggered the crash.

With the attached patch, document refreshes appear to be solid. This should probably be tested and pushed to clients soon, since early adopters of 2.1beta are likely to be frustrated by it.

I have the document here, and a small Zotero database that drives it, if needed for testing. I've confirmed that it triggers the crash in Zotero 2.1b5."	defect	closed	critical		word integration	2.1	fixed		
