www

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

commit ce4327ddb626003bfce12492e5ec1d57ab101aad
parent 0531960e61d9d528ab626dc80dcfb829ef321cca
Author: Dan Stillman <dstillman@zotero.org>
Date:   Sun, 17 Jan 2010 11:25:25 +0000

Update (deprecated) Zotero.Item.toArray() to not substitute 'title' for base-mapped title fields, since this isn't done for other base-mapped fields

Report generation and a couple other things might need to be updated to deal with this


Diffstat:
Mchrome/content/zotero/xpcom/data/item.js | 19+++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js @@ -4048,20 +4048,11 @@ Zotero.Item.prototype.toArray = function (mode) { arr[Zotero.ItemFields.getName(i)] = this._itemData[i] ? this._itemData[i] + '': ''; } - if (!arr.title) { - var titleFieldID = Zotero.ItemFields.getFieldIDFromTypeAndBase(this.itemTypeID, 'title'); - var titleFieldName = Zotero.ItemFields.getName(titleFieldID); - if (arr[titleFieldName]) { - arr.title = titleFieldName; - delete arr[titleFieldName]; - } - - switch (this.typeID) { - case Zotero.ItemTypes.getID('note'): - break; - - default: - arr.title = this.getDisplayTitle(mode == 2) + ''; + if (mode == 1 || mode == 2) { + if (!arr.title && + (this.itemTypeID == Zotero.ItemTypes.getID('letter') || + this.itemTypeID == Zotero.ItemTypes.getID('interview'))) { + arr.title = this.getDisplayTitle(mode == 2) + ''; } }