- Fix "creator.serialize() is not a function" sync error

- Added Zotero.Utilities.isEmpty(obj)
This commit is contained in:
Dan Stillman 2009-02-12 08:00:29 +00:00
parent e84f7f6ef8
commit fd1ac3104a
2 changed files with 17 additions and 1 deletions

View file

@ -2452,7 +2452,9 @@ Zotero.Sync.Server.Data = new function() {
};
if (type == 'item') {
io.dataIn.changedCreators = changedCreators;
if (!Zotero.Utilities.prototype.isEmpty(changedCreators)) {
io.dataIn.changedCreators = changedCreators;
}
}
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]

View file

@ -291,6 +291,20 @@ Zotero.Utilities.prototype.isInt = function(x) {
}
/**
* Test if an object is empty
*
* @param {Object}
*/
Zotero.Utilities.prototype.isEmpty = function (obj) {
for (var i in obj) {
return false;
}
return true;
}
/**
* Compares an array with another and returns an array with
* the values from array2 that don't exist in array1