www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit d41c8d648916831042da4114477e4de349df6d30
parent 553d2b00d86f852e051a9d76474993cd0575f7cd
Author: Adomas VenĨkauskas <adomas.ven@gmail.com>
Date:   Mon, 22 Jan 2018 13:26:36 +0200

Fix an integration error when bibl present without citations

Diffstat:
Mchrome/content/zotero/xpcom/integration.js | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js @@ -837,7 +837,7 @@ Zotero.Integration.Fields.prototype.get = new function() { }; } } else if(topic === "fields-error") { - deferred.reject(e); + deferred.reject(data); deferred = null; } }, QueryInterface:XPCOMUtils.generateQI([Components.interfaces.nsIObserver, Components.interfaces.nsISupports])}); @@ -912,6 +912,8 @@ Zotero.Integration.Fields.prototype._processFields = Zotero.Promise.coroutine(fu if (this._bibliographyFields.length) { this._session.bibliography = new Zotero.Integration.Bibliography(this._bibliographyFields[0]); yield this._session.bibliography.loadItemData(); + } else { + delete this._session.bibliography; } // TODO: figure this out // Zotero.Notifier.trigger('add', 'collection', 'document'); @@ -991,10 +993,11 @@ Zotero.Integration.Fields.prototype._updateDocument = async function(forceCitati var isRich = false; if (!citation.properties.dontUpdate) { - var formattedCitation = citation.properties.formattedCitation && citation.properties.custom + var formattedCitation = citation.properties.custom ? citation.properties.custom : citation.text; var plainCitation = citation.properties.plainCitation && citationField.getText(); + // Update citation text: // If we're not specifically *not* trying to regen text if (forceCitations != FORCE_CITATIONS_FALSE // Or metadata has changed thus changing the formatted citation