diff --git a/chrome/content/zotero/integration/quickFormat.xul b/chrome/content/zotero/integration/quickFormat.xul
index 41165cfdd..edfd48183 100644
--- a/chrome/content/zotero/integration/quickFormat.xul
+++ b/chrome/content/zotero/integration/quickFormat.xul
@@ -33,7 +33,7 @@
-
-
@@ -117,7 +115,7 @@ To add a new preference:
-
+
@@ -126,14 +124,11 @@ To add a new preference:
-
-
-
+
-
@@ -167,9 +162,9 @@ To add a new preference:
-
-
-
+
+
+
@@ -272,9 +267,8 @@ To add a new preference:
+ onkeypress="if (Zotero.isMac && event.keyCode == 13) { this.blur(); setTimeout(verifyStorageServer, 1); }"
+ onchange="unverifyStorageServer(); this.value = this.value.replace(/(^https?:\/\/|\/zotero\/?$|\/$)/g, ''); Zotero.Prefs.set('extensions.zotero.sync.storage.url', this.value)"/>
@@ -284,8 +278,7 @@ To add a new preference:
+ onchange="unverifyStorageServer(); Zotero.Prefs.set('extensions.zotero.sync.storage.username', this.value); var pass = document.getElementById('storage-password'); if (pass.value) { Zotero.Sync.Storage.WebDAV.password = pass.value; }"/>
@@ -293,8 +286,7 @@ To add a new preference:
+ onchange="unverifyStorageServer(); Zotero.Sync.Storage.WebDAV.password = this.value;"/>
diff --git a/chrome/content/zotero/preferences/preferences_firefox.xul b/chrome/content/zotero/preferences/preferences_firefox.xul
index 1a851e267..0cce97561 100644
--- a/chrome/content/zotero/preferences/preferences_firefox.xul
+++ b/chrome/content/zotero/preferences/preferences_firefox.xul
@@ -48,6 +48,13 @@ To add a new preference:
+
+
+
@@ -75,6 +82,20 @@ To add a new preference:
+
+
+
+
+
0 || oldIDs.length != currentIDs.length) {
- this._prepFieldChange('relatedItems');
+ this._markFieldChange('related', currentIDs);
+ this._changed.relatedItems = true
}
else {
Zotero.debug('Related items not changed in Zotero.Item._setRelatedItems()', 4);
@@ -4918,17 +4989,58 @@ Zotero.Item.prototype._setRelatedItems = function (itemIDs) {
}
-// TODO: use for stuff other than related items
-Zotero.Item.prototype._prepFieldChange = function (field) {
- if (!this._changed) {
- this._changed = {};
+/**
+ * The creator has already been changed in itembox.xml before being passed
+ * to setCreator()/removeCreator(), so we have to reach in and get its
+ * previousData, and ideally try to detect when this private data structure
+ * has changed, which it almost certainly will. I am so sorry.
+ */
+Zotero.Item.prototype._getOldCreators = function () {
+ var oldCreators = [];
+ for (var i in this._creators) {
+ if (this._creators[i].ref._changed) {
+ if (!this._creators[i].ref._previousData
+ && !this._creators[i].ref._previousData.fields) {
+ Components.utils.reportError("Previous creator data not available in expected form");
+ oldCreators.push(false);
+ continue;
+ }
+ var c = this._creators[i].ref._previousData.fields;
+ }
+ else {
+ var c = this._creators[i].ref;
+ }
+
+ var old = {
+ // Convert creatorTypeIDs to text
+ creatorType: Zotero.CreatorTypes.getName(
+ this._creators[i].creatorTypeID
+ )
+ };
+
+ if (c.fieldMode) {
+ // In 'fields' there's just 'name' for single-field mode
+ old.name = typeof c.name == 'undefined' ? c.lastName : c.name;
+ }
+ else {
+ old.firstName = c.firstName;
+ old.lastName = c.lastName;
+ }
+ oldCreators.push(old);
}
- this._changed[field] = true;
-
- // Save a copy of the data before changing
- if (this.id && this.exists() && !this._previousData) {
- this._previousData = this.serialize();
+ return oldCreators;
+}
+
+
+/**
+ * Save old version of data that's being changed, to pass to the notifier
+ */
+Zotero.Item.prototype._markFieldChange = function (field, oldValue) {
+ // Only save if item already exists and field not already changed
+ if (!this.id || !this.exists() || this._previousData[field]) {
+ return;
}
+ this._previousData[field] = oldValue;
}
diff --git a/chrome/content/zotero/xpcom/http.js b/chrome/content/zotero/xpcom/http.js
index afa9ac0ca..236841415 100644
--- a/chrome/content/zotero/xpcom/http.js
+++ b/chrome/content/zotero/xpcom/http.js
@@ -746,9 +746,10 @@ Zotero.HTTP = new function() {
/**
* Handler for XMLHttpRequest state change
*
- * @param {nsIXMLHttpRequest} XMLHttpRequest whose state just changed
- * @param {Function} [onDone] Callback for request completion
+ * @param {nsIXMLHttpRequest} xmlhttp XMLHttpRequest whose state just changed
+ * @param {Function} [callback] Callback for request completion
* @param {String} [responseCharset] Character set to force on the response
+ * @param {*} [data] Data to be passed back to callback as the second argument
* @private
*/
function _stateChange(xmlhttp, callback, responseCharset, data) {
diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js
index e860ee9db..c6648b3a5 100644
--- a/chrome/content/zotero/xpcom/itemTreeView.js
+++ b/chrome/content/zotero/xpcom/itemTreeView.js
@@ -231,6 +231,14 @@ Zotero.ItemTreeView.prototype._refreshGenerator = function()
this._searchMode = this._itemGroup.isSearchMode();
+ if (!this.selection.selectEventsSuppressed) {
+ var unsuppress = this.selection.selectEventsSuppressed = true;
+ this._treebox.beginUpdateBatch();
+ }
+ var savedSelection = this.saveSelection();
+ var savedOpenState = this.saveOpenState();
+ var savedFirstRow = this.saveFirstRow();
+
var oldRows = this.rowCount;
this._dataItems = [];
this._searchItemIDs = {}; // items matching the search
@@ -317,6 +325,15 @@ Zotero.ItemTreeView.prototype._refreshGenerator = function()
Zotero.UnresponsiveScriptIndicator.enable();
}
+ this.rememberOpenState(savedOpenState);
+ this.rememberFirstRow(savedFirstRow);
+ this.rememberSelection(savedSelection);
+ this.expandMatchParents();
+ if (unsuppress) {
+ this._treebox.endUpdateBatch();
+ this.selection.selectEventsSuppressed = false;
+ }
+
yield false;
}
@@ -425,6 +442,7 @@ Zotero.ItemTreeView.prototype.notify = function(action, type, ids, extraData)
}
this.selection.selectEventsSuppressed = true;
+ this._treebox.beginUpdateBatch();
if ((action == 'remove' && !itemGroup.isLibrary(true))
|| action == 'delete' || action == 'trash') {
@@ -607,9 +625,20 @@ Zotero.ItemTreeView.prototype.notify = function(action, type, ids, extraData)
// Otherwise re-run the search, which refreshes the item list
else
{
- // For item adds, clear quicksearch
+ // For item adds, clear the quicksearch, unless all the new items
+ // are child items
if (activeWindow && type == 'item') {
- quicksearch.value = '';
+ var clear = false;
+ var items = Zotero.Items.get(ids);
+ for each(var item in items) {
+ if (!item.getSource()) {
+ clear = true;
+ break;
+ }
+ }
+ if (clear) {
+ quicksearch.value = '';
+ }
}
quicksearch.doCommand();
madeChanges = true;
@@ -755,6 +784,7 @@ Zotero.ItemTreeView.prototype.notify = function(action, type, ids, extraData)
this.rememberSelection(savedSelection);
}
+ this._treebox.endUpdateBatch();
this.selection.selectEventsSuppressed = false;
}
@@ -1462,6 +1492,11 @@ Zotero.ItemTreeView.prototype.sort = function(itemID)
}
// Need to close all containers before sorting
+ if (!this.selection.selectEventsSuppressed) {
+ var unsuppress = this.selection.selectEventsSuppressed = true;
+ this._treebox.beginUpdateBatch();
+ }
+ var savedSelection = this.saveSelection();
var openItemIDs = this.saveOpenState(true);
// Single-row sort
@@ -1505,6 +1540,12 @@ Zotero.ItemTreeView.prototype.sort = function(itemID)
this._refreshHashMap();
this.rememberOpenState(openItemIDs);
+ this.rememberSelection(savedSelection);
+
+ if (unsuppress) {
+ this.selection.selectEventsSuppressed = false;
+ this._treebox.endUpdateBatch();
+ }
}
////////////////////////////////////////////////////////////////////////////////
@@ -1720,7 +1761,7 @@ Zotero.ItemTreeView.prototype.deleteSelection = function (force)
/*
- * Set the tags filter on the view
+ * Set the search/tags filter on the view
*/
Zotero.ItemTreeView.prototype.setFilter = function(type, data) {
if (!this._treebox || !this._treebox.treeBody) {
@@ -1729,9 +1770,7 @@ Zotero.ItemTreeView.prototype.setFilter = function(type, data) {
}
this.selection.selectEventsSuppressed = true;
- var savedSelection = this.saveSelection();
- var savedOpenState = this.saveOpenState();
- var savedFirstRow = this.saveFirstRow();
+ this._treebox.beginUpdateBatch();
switch (type) {
case 'search':
@@ -1748,11 +1787,7 @@ Zotero.ItemTreeView.prototype.setFilter = function(type, data) {
this.sort();
- this.rememberOpenState(savedOpenState);
- this.expandMatchParents();
- this.rememberFirstRow(savedFirstRow);
- this.rememberSelection(savedSelection);
- this._treebox.invalidate();
+ this._treebox.endUpdateBatch();
this.selection.selectEventsSuppressed = false;
//Zotero.debug('Running callbacks in itemTreeView.setFilter()', 4);
@@ -1833,6 +1868,10 @@ Zotero.ItemTreeView.prototype.rememberSelection = function(selection)
{
this.selection.clearSelection();
+ if (!this.selection.selectEventsSuppressed) {
+ var unsuppress = this.selection.selectEventsSuppressed = true;
+ this._treebox.beginUpdateBatch();
+ }
for(var i=0; i < selection.length; i++)
{
if (this._itemRowMap[selection[i]] != null) {
@@ -1859,6 +1898,10 @@ Zotero.ItemTreeView.prototype.rememberSelection = function(selection)
}
}
}
+ if (unsuppress) {
+ this._treebox.endUpdateBatch();
+ this.selection.selectEventsSuppressed = false;
+ }
}
@@ -1878,6 +1921,12 @@ Zotero.ItemTreeView.prototype.selectSearchMatches = function () {
Zotero.ItemTreeView.prototype.saveOpenState = function(close) {
var itemIDs = [];
+ if (close) {
+ if (!this.selection.selectEventsSuppressed) {
+ var unsuppress = this.selection.selectEventsSuppressed = true;
+ this._treebox.beginUpdateBatch();
+ }
+ }
for (var i=0; i=0; i--) {
this.toggleOpenState(rowsToOpen[i], true);
}
- this._treebox.endUpdateBatch();
this._refreshHashMap();
+ if (unsuppress) {
+ this._treebox.endUpdateBatch();
+ this.selection.selectEventsSuppressed = false;
+ }
}
@@ -1928,7 +1987,10 @@ Zotero.ItemTreeView.prototype.expandMatchParents = function () {
hash[id] = true;
}
- this._treebox.beginUpdateBatch();
+ if (!this.selection.selectEventsSuppressed) {
+ var unsuppress = this.selection.selectEventsSuppressed = true;
+ this._treebox.beginUpdateBatch();
+ }
for (var i=0; i
+
diff --git a/chrome/locale/ar/zotero/zotero.dtd b/chrome/locale/ar/zotero/zotero.dtd
index 66c4cfe67..360caed42 100644
--- a/chrome/locale/ar/zotero/zotero.dtd
+++ b/chrome/locale/ar/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/bg-BG/zotero/zotero.dtd b/chrome/locale/bg-BG/zotero/zotero.dtd
index f7e9d4082..e87cada26 100644
--- a/chrome/locale/bg-BG/zotero/zotero.dtd
+++ b/chrome/locale/bg-BG/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/ca-AD/zotero/zotero.dtd b/chrome/locale/ca-AD/zotero/zotero.dtd
index 5057ca2a2..619a797ab 100644
--- a/chrome/locale/ca-AD/zotero/zotero.dtd
+++ b/chrome/locale/ca-AD/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/cs-CZ/zotero/zotero.dtd b/chrome/locale/cs-CZ/zotero/zotero.dtd
index 9a0e225e1..e2c5c0e59 100644
--- a/chrome/locale/cs-CZ/zotero/zotero.dtd
+++ b/chrome/locale/cs-CZ/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/da-DK/zotero/zotero.dtd b/chrome/locale/da-DK/zotero/zotero.dtd
index e999bc5d9..fa03871e3 100644
--- a/chrome/locale/da-DK/zotero/zotero.dtd
+++ b/chrome/locale/da-DK/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/de/zotero/zotero.dtd b/chrome/locale/de/zotero/zotero.dtd
index 1f4a733e4..dd097b893 100644
--- a/chrome/locale/de/zotero/zotero.dtd
+++ b/chrome/locale/de/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/el-GR/zotero/zotero.dtd b/chrome/locale/el-GR/zotero/zotero.dtd
index f03eff911..fd1f3f5a7 100644
--- a/chrome/locale/el-GR/zotero/zotero.dtd
+++ b/chrome/locale/el-GR/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/en-US/zotero/zotero.dtd b/chrome/locale/en-US/zotero/zotero.dtd
index c3bbb9123..19ace9481 100644
--- a/chrome/locale/en-US/zotero/zotero.dtd
+++ b/chrome/locale/en-US/zotero/zotero.dtd
@@ -159,6 +159,7 @@
+
diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties
index 8ec659a8f..392a0b4c0 100644
--- a/chrome/locale/en-US/zotero/zotero.properties
+++ b/chrome/locale/en-US/zotero/zotero.properties
@@ -449,6 +449,7 @@ db.integrityCheck.reportInForums = You can report this problem in the Zotero For
zotero.preferences.update.updated = Updated
zotero.preferences.update.upToDate = Up to date
zotero.preferences.update.error = Error
+zotero.preferences.launchNonNativeFiles = Open PDFs and other files within %S when possible
zotero.preferences.openurl.resolversFound.zero = %S resolvers found
zotero.preferences.openurl.resolversFound.singular = %S resolver found
zotero.preferences.openurl.resolversFound.plural = %S resolvers found
diff --git a/chrome/locale/es-ES/zotero/zotero.dtd b/chrome/locale/es-ES/zotero/zotero.dtd
index 57f9bdfd9..1e7168805 100644
--- a/chrome/locale/es-ES/zotero/zotero.dtd
+++ b/chrome/locale/es-ES/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/et-EE/zotero/zotero.dtd b/chrome/locale/et-EE/zotero/zotero.dtd
index 0d42f610b..18785e3bc 100644
--- a/chrome/locale/et-EE/zotero/zotero.dtd
+++ b/chrome/locale/et-EE/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/eu-ES/zotero/zotero.dtd b/chrome/locale/eu-ES/zotero/zotero.dtd
index 0c1d1eeeb..5c1331878 100644
--- a/chrome/locale/eu-ES/zotero/zotero.dtd
+++ b/chrome/locale/eu-ES/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/fa/zotero/zotero.dtd b/chrome/locale/fa/zotero/zotero.dtd
index 696442818..9c4c8cff7 100644
--- a/chrome/locale/fa/zotero/zotero.dtd
+++ b/chrome/locale/fa/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/fi-FI/zotero/zotero.dtd b/chrome/locale/fi-FI/zotero/zotero.dtd
index 0be971f75..ed8beeb54 100644
--- a/chrome/locale/fi-FI/zotero/zotero.dtd
+++ b/chrome/locale/fi-FI/zotero/zotero.dtd
@@ -144,6 +144,7 @@
+
diff --git a/chrome/locale/fr-FR/zotero/zotero.dtd b/chrome/locale/fr-FR/zotero/zotero.dtd
index 1eeeae01a..1b96c1f0e 100644
--- a/chrome/locale/fr-FR/zotero/zotero.dtd
+++ b/chrome/locale/fr-FR/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/gl-ES/zotero/zotero.dtd b/chrome/locale/gl-ES/zotero/zotero.dtd
index 03d11424a..37ec30aff 100644
--- a/chrome/locale/gl-ES/zotero/zotero.dtd
+++ b/chrome/locale/gl-ES/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/he-IL/zotero/zotero.dtd b/chrome/locale/he-IL/zotero/zotero.dtd
index 45bb27324..55475407b 100644
--- a/chrome/locale/he-IL/zotero/zotero.dtd
+++ b/chrome/locale/he-IL/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/hr-HR/zotero/zotero.dtd b/chrome/locale/hr-HR/zotero/zotero.dtd
index f03eff911..fd1f3f5a7 100644
--- a/chrome/locale/hr-HR/zotero/zotero.dtd
+++ b/chrome/locale/hr-HR/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/hu-HU/zotero/zotero.dtd b/chrome/locale/hu-HU/zotero/zotero.dtd
index a2c0c4b47..168cbfbc2 100644
--- a/chrome/locale/hu-HU/zotero/zotero.dtd
+++ b/chrome/locale/hu-HU/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/is-IS/zotero/zotero.dtd b/chrome/locale/is-IS/zotero/zotero.dtd
index 1b83f9486..70ddabc64 100644
--- a/chrome/locale/is-IS/zotero/zotero.dtd
+++ b/chrome/locale/is-IS/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/it-IT/zotero/zotero.dtd b/chrome/locale/it-IT/zotero/zotero.dtd
index 39bd426a7..9a3d971ca 100644
--- a/chrome/locale/it-IT/zotero/zotero.dtd
+++ b/chrome/locale/it-IT/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/ja-JP/zotero/zotero.dtd b/chrome/locale/ja-JP/zotero/zotero.dtd
index 383c8feaf..3bd8a8d9b 100644
--- a/chrome/locale/ja-JP/zotero/zotero.dtd
+++ b/chrome/locale/ja-JP/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/km/zotero/zotero.dtd b/chrome/locale/km/zotero/zotero.dtd
index 4fe18f8dd..741a20428 100644
--- a/chrome/locale/km/zotero/zotero.dtd
+++ b/chrome/locale/km/zotero/zotero.dtd
@@ -144,6 +144,7 @@
+
diff --git a/chrome/locale/ko-KR/zotero/zotero.dtd b/chrome/locale/ko-KR/zotero/zotero.dtd
index 13afa040d..282195ced 100644
--- a/chrome/locale/ko-KR/zotero/zotero.dtd
+++ b/chrome/locale/ko-KR/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/mn-MN/zotero/zotero.dtd b/chrome/locale/mn-MN/zotero/zotero.dtd
index cb2972ed9..c9f9ee751 100644
--- a/chrome/locale/mn-MN/zotero/zotero.dtd
+++ b/chrome/locale/mn-MN/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/nb-NO/zotero/zotero.dtd b/chrome/locale/nb-NO/zotero/zotero.dtd
index 387f9e804..dfd916877 100644
--- a/chrome/locale/nb-NO/zotero/zotero.dtd
+++ b/chrome/locale/nb-NO/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/nl-NL/zotero/zotero.dtd b/chrome/locale/nl-NL/zotero/zotero.dtd
index 447282d5e..42d604bdb 100644
--- a/chrome/locale/nl-NL/zotero/zotero.dtd
+++ b/chrome/locale/nl-NL/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/nn-NO/zotero/zotero.dtd b/chrome/locale/nn-NO/zotero/zotero.dtd
index 3e50b43b6..81c9080a3 100644
--- a/chrome/locale/nn-NO/zotero/zotero.dtd
+++ b/chrome/locale/nn-NO/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/pl-PL/zotero/zotero.dtd b/chrome/locale/pl-PL/zotero/zotero.dtd
index 62347fd58..c00ef3a89 100644
--- a/chrome/locale/pl-PL/zotero/zotero.dtd
+++ b/chrome/locale/pl-PL/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/pt-BR/zotero/zotero.dtd b/chrome/locale/pt-BR/zotero/zotero.dtd
index c8880cfac..818e0c3a5 100644
--- a/chrome/locale/pt-BR/zotero/zotero.dtd
+++ b/chrome/locale/pt-BR/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/pt-PT/zotero/zotero.dtd b/chrome/locale/pt-PT/zotero/zotero.dtd
index 6bcedd3e7..fe89d8545 100644
--- a/chrome/locale/pt-PT/zotero/zotero.dtd
+++ b/chrome/locale/pt-PT/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/ro-RO/zotero/zotero.dtd b/chrome/locale/ro-RO/zotero/zotero.dtd
index 1b7657a0b..372f7f201 100644
--- a/chrome/locale/ro-RO/zotero/zotero.dtd
+++ b/chrome/locale/ro-RO/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/ru-RU/zotero/zotero.dtd b/chrome/locale/ru-RU/zotero/zotero.dtd
index e8b52d01e..5f8d3e3ab 100644
--- a/chrome/locale/ru-RU/zotero/zotero.dtd
+++ b/chrome/locale/ru-RU/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/sk-SK/zotero/zotero.dtd b/chrome/locale/sk-SK/zotero/zotero.dtd
index 87ccdbd6a..1d67cc131 100644
--- a/chrome/locale/sk-SK/zotero/zotero.dtd
+++ b/chrome/locale/sk-SK/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/sl-SI/zotero/zotero.dtd b/chrome/locale/sl-SI/zotero/zotero.dtd
index 4d5d8a3af..da9b3c91a 100644
--- a/chrome/locale/sl-SI/zotero/zotero.dtd
+++ b/chrome/locale/sl-SI/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/sr-RS/zotero/zotero.dtd b/chrome/locale/sr-RS/zotero/zotero.dtd
index f659a5a04..a84af42c0 100644
--- a/chrome/locale/sr-RS/zotero/zotero.dtd
+++ b/chrome/locale/sr-RS/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/sv-SE/zotero/zotero.dtd b/chrome/locale/sv-SE/zotero/zotero.dtd
index 4c4ecff6f..9c58ea649 100644
--- a/chrome/locale/sv-SE/zotero/zotero.dtd
+++ b/chrome/locale/sv-SE/zotero/zotero.dtd
@@ -144,6 +144,7 @@
+
diff --git a/chrome/locale/th-TH/zotero/zotero.dtd b/chrome/locale/th-TH/zotero/zotero.dtd
index d8cafd251..aa8cff8fb 100644
--- a/chrome/locale/th-TH/zotero/zotero.dtd
+++ b/chrome/locale/th-TH/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/tr-TR/zotero/zotero.dtd b/chrome/locale/tr-TR/zotero/zotero.dtd
index 8c6b6d536..6cc328824 100644
--- a/chrome/locale/tr-TR/zotero/zotero.dtd
+++ b/chrome/locale/tr-TR/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/vi-VN/zotero/zotero.dtd b/chrome/locale/vi-VN/zotero/zotero.dtd
index 5b138a46b..958dfe904 100644
--- a/chrome/locale/vi-VN/zotero/zotero.dtd
+++ b/chrome/locale/vi-VN/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/zh-CN/zotero/zotero.dtd b/chrome/locale/zh-CN/zotero/zotero.dtd
index db023b894..187e938d1 100644
--- a/chrome/locale/zh-CN/zotero/zotero.dtd
+++ b/chrome/locale/zh-CN/zotero/zotero.dtd
@@ -143,6 +143,7 @@
+
diff --git a/chrome/locale/zh-TW/zotero/zotero.dtd b/chrome/locale/zh-TW/zotero/zotero.dtd
index 56b331d95..483365faf 100644
--- a/chrome/locale/zh-TW/zotero/zotero.dtd
+++ b/chrome/locale/zh-TW/zotero/zotero.dtd
@@ -144,6 +144,7 @@
+
diff --git a/components/zotero-autocomplete.js b/components/zotero-autocomplete.js
index 4639b7ef4..f1b11eaba 100644
--- a/components/zotero-autocomplete.js
+++ b/components/zotero-autocomplete.js
@@ -88,6 +88,9 @@ ZoteroAutoComplete.prototype.startSearch = function(searchString, searchParam, p
statement = this._zotero.DB.getStatement(sql, sqlParams);
var resultsCallback = function (results) {
+ if (!results) {
+ return;
+ }
var collation = self._zotero.getLocaleCollation();
results.sort(function(a, b) {
return collation.compareString(1, a.val, b.val);