From 25fbec095f251340d1bb0178a18e7459dd111b00 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 31 Jan 2011 20:16:06 +0000 Subject: [PATCH] fix hasBibliography call for dependent styles --- chrome/content/zotero/xpcom/style.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/style.js b/chrome/content/zotero/xpcom/style.js index c1866d6db..6d2aea000 100644 --- a/chrome/content/zotero/xpcom/style.js +++ b/chrome/content/zotero/xpcom/style.js @@ -447,7 +447,22 @@ Zotero.Style.prototype.__defineGetter__("hasBibliography", * @type String */ function() { - if(!this._hasBibliography) this.getXML(); + if(this.source) { + // use hasBibliography from source style + var parentStyle = Zotero.Styles.get(this.source); + if(!parentStyle) { + throw(new Error('Style references '+this.source+', but this style is not installed', + Zotero.Styles.ios.newFileURI(this.file).spec, null)); + } + return parentStyle.hasBibliography; + } + + if(!this._hasBibliography) { + // if we don't know whether this style has a bibliography, it's because it's an ens style + // and we have to parse it to know + this.getXML(); + } + return this._hasBibliography; });