Sanitize primary fields in setField before comparing to current value

This commit is contained in:
Aurimas Vinckevicius 2014-11-14 05:11:42 -06:00
parent f0aae549c5
commit 20444eceb7

View file

@ -718,8 +718,14 @@ Zotero.Item.prototype.setField = function(field, value, loadIn) {
case 'itemTypeID':
case 'dateAdded':
case 'dateModified':
break;
case 'version':
value = parseInt(value);
break;
case 'synced':
value = !!value;
break;
default:
@ -744,15 +750,6 @@ Zotero.Item.prototype.setField = function(field, value, loadIn) {
this.setType(value, loadIn);
}
else {
switch (field) {
case 'version':
value = parseInt(value);
break;
case 'synced':
value = !!value;
break;
}
this['_' + field] = value;