www

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

commit 67f28eada3505aa51bcb9af6e4a9b3e88daf6da3
parent ee389f106e3e055bb0b7954d17b5c19b77d4bb13
Author: Dan Stillman <dstillman@zotero.org>
Date:   Wed, 10 Dec 2014 17:03:38 -0500

Merge pull request #595 from aurimasv/dup-isbn

Fix duplicate matching when ISBN is non-sensical
Diffstat:
Mchrome/content/zotero/xpcom/duplicates.js | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/chrome/content/zotero/xpcom/duplicates.js b/chrome/content/zotero/xpcom/duplicates.js @@ -170,7 +170,9 @@ Zotero.Duplicates.prototype._findDuplicates = function () { } // If no comparison function, check for exact match else { - if (rows[i].value !== rows[j].value) { + if (!rows[i].value || !rows[j].value + || (rows[i].value !== rows[j].value) + ) { break; } } @@ -205,8 +207,8 @@ Zotero.Duplicates.prototype._findDuplicates = function () { var isbnCache = {}; if (rows) { for each(var row in rows) { - row.value = (row.value+'').replace(/[^\dX]+/ig, '').toUpperCase(); //ignore formatting - isbnCache[row.itemID] = row.value; + row.value = Zotero.Utilities.cleanISBN('' + row.value); + if (row.value) isbnCache[row.itemID] = row.value; } rows.sort(sortByValue); processRows();