Fix duplicate matching when ISBN is non-sensical
Re https://forums.zotero.org/discussion/43046/items-mistakenly-identified-as-duplicates/
This commit is contained in:
parent
ee389f106e
commit
2f79cb221f
1 changed files with 5 additions and 3 deletions
|
@ -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 a new issue