www

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

commit f0013ef37d16df4bfc9de37498b225acdf6fec7e
parent d514f02c34c2443fbfafe42c817e73b890059f90
Author: Simon Kornblith <simon@simonster.com>
Date:   Thu,  1 Mar 2012 23:26:48 -0500

Fix Chrome translator testing

Diffstat:
Mchrome/content/zotero/tools/testTranslators/translatorTester.js | 12++++--------
1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/chrome/content/zotero/tools/testTranslators/translatorTester.js b/chrome/content/zotero/tools/testTranslators/translatorTester.js @@ -215,7 +215,7 @@ Zotero_TranslatorTester._sanitizeItem = function(item, forSave) { // remove fields that don't exist or aren't valid for this item type, and normalize base fields // to fields specific to this item - var fieldID, + var fieldID, itemFieldID, typeID = Zotero.ItemTypes.getID(item.itemType); const skipFields = ["note", "notes", "itemID", "attachments", "tags", "seeAlso", "itemType", "complete", "creators"]; @@ -227,14 +227,10 @@ Zotero_TranslatorTester._sanitizeItem = function(item, forSave) { continue; } - if(Zotero.ItemFields.isBaseField(fieldID)) { + if(itemFieldID = Zotero.ItemFields.getFieldIDFromTypeAndBase(typeID, fieldID)) { var value = item[field]; - delete item[field]; - - var itemFieldID = Zotero.ItemFields.getFieldIDFromTypeAndBase(typeID, fieldID); - if(itemFieldID) { - item[Zotero.ItemFields.getName(itemFieldID)] = value; - } + delete item[field]; + item[Zotero.ItemFields.getName(itemFieldID)] = value; continue; }