Merge pull request #595 from aurimasv/dup-isbn
Fix duplicate matching when ISBN is non-sensical
This commit is contained in:
commit
67f28eada3
|
@ -170,7 +170,9 @@ Zotero.Duplicates.prototype._findDuplicates = function () {
|
||||||
}
|
}
|
||||||
// If no comparison function, check for exact match
|
// If no comparison function, check for exact match
|
||||||
else {
|
else {
|
||||||
if (rows[i].value !== rows[j].value) {
|
if (!rows[i].value || !rows[j].value
|
||||||
|
|| (rows[i].value !== rows[j].value)
|
||||||
|
) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -205,8 +207,8 @@ Zotero.Duplicates.prototype._findDuplicates = function () {
|
||||||
var isbnCache = {};
|
var isbnCache = {};
|
||||||
if (rows) {
|
if (rows) {
|
||||||
for each(var row in rows) {
|
for each(var row in rows) {
|
||||||
row.value = (row.value+'').replace(/[^\dX]+/ig, '').toUpperCase(); //ignore formatting
|
row.value = Zotero.Utilities.cleanISBN('' + row.value);
|
||||||
isbnCache[row.itemID] = row.value;
|
if (row.value) isbnCache[row.itemID] = row.value;
|
||||||
}
|
}
|
||||||
rows.sort(sortByValue);
|
rows.sort(sortByValue);
|
||||||
processRows();
|
processRows();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user