From 828d10a3967ccfaf5298137d86d26097a0601d6c Mon Sep 17 00:00:00 2001 From: aurimasv Date: Fri, 9 Mar 2012 20:00:21 -0600 Subject: [PATCH] Sort in _sanitizeItem instead of _compare --- .../zotero/tools/testTranslators/translatorTester.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/tools/testTranslators/translatorTester.js b/chrome/content/zotero/tools/testTranslators/translatorTester.js index 29a7a0814..ff0919873 100644 --- a/chrome/content/zotero/tools/testTranslators/translatorTester.js +++ b/chrome/content/zotero/tools/testTranslators/translatorTester.js @@ -220,7 +220,12 @@ Zotero_TranslatorTester._sanitizeItem = function(item, forSave) { const skipFields = ["note", "notes", "itemID", "attachments", "tags", "seeAlso", "itemType", "complete", "creators"]; for(var field in item) { - if(skipFields.indexOf(field) !== -1) continue; + if(skipFields.indexOf(field) !== -1) { + if(field == 'tags') { + item[field].sort(); + } + continue; + } if(!item[field] || !(fieldID = Zotero.ItemFields.getID(field))) { delete item[field]; @@ -574,8 +579,6 @@ Zotero_TranslatorTester.prototype._compare = function(i, j) { var match = false; if (Object.prototype.toString.apply(i) === '[object Array]') { if (Object.prototype.toString.apply(j) === '[object Array]') { - i.sort(); - j.sort(); do { match = this._compare(i.pop(), j.pop()); } while (match && i.length && j.length);